#include
#include
int main()
{
clrscr();
int n,s1,s2,i,fn;
cout<<"Enter value of n: "; cin>>n;
if(n<=1)
cout<
{
s1=0,s2=1;
cout<<"Output: "<
{
fn=s1+s2;
cout<
s2=fn;
}
}
getch();
return 0;
}
Output:
Enter value of n: 10
Output: 0 1 1 2 3 5 8 13 21 34 55
No comments:
Post a Comment