#include<stdio.h>
#include<conio.h>
void main()
{ int a,b,c,no,i;
clrscr();
printf("enter the vlue of no=");
scanf("%d",&no);
a=1;
b=0;
c=0;
for(i=1;i<=no;i++)
{
c=a+b;
printf(" %d\t",c);
a=b;
b=c;
}
getch();
}
OUTPUT
enter the vlue of no=8
1 1 2 3 5 8 13 21
Tweet
Comments
Post a Comment