'

Assignments » Flow Of Control » Set 2 » Solution 12

Source Code: 


#include<iostream>
using namespace std;


int main()
{
 int f=0,s=1,t,n;
 
 cout<<"Enter Number of terms of Series : ";
 cin>>n;
 
 cout<<f<<" "<<s<<" ";
 
 for(int i=3;i<=n;i++)
 {
  t=f+s;
  cout<<t<<" ";
  f=s;
  s=t;
 }
 
 
 return 0;
}



Post a Comment

:) :)) ;(( :-) =)) ;( ;-( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ $-) (b) (f) x-) (k) (h) (c) cheer
Click to see the code!
To insert emoticon you must added at least one space before the code.

 
Top