#include<stdio.h>    

main()    

{    

 int n1=0,n2=1,n3,i,n;    

 printf(“Enter the number of elements:”);    

 scanf(“%d”,&n);    

 printf(“\n%d %d”,n1,n2);    

 for(i=2;i<n;++i)    

 {    

  n3=n1+n2;    

  printf(” %d”,n3);    

  n1=n2;    

  n2=n3;    

 }  

  return 0;  

 }    

output :

Enter the number of elements:15

0 1 1 2 3 5 8 13 21 34 55 89 144 233 377

Leave a Reply

Your email address will not be published. Required fields are marked *