#include<stdio.h> #include<iostream> using namespace std; int fabi(int); main() { int num,i,num1=0,num2=1,nex; cout<<"enter the number: "; cin>>num; for(i=0;i<=num;i++) { if ( i <= 1 ) nex = i; else { nex = num1 + num2; num1 = num2; num2 = nex; } cout << nex; cout<<","; } cout<<endl; system("pause"); return 0; }
0 comments:
Post a Comment