Answers

  • Brainly User
2014-02-20T16:59:01+05:30
#include<stdio.h>
#include<math.h>
#include<conio.h>
void main()
{   int n, a, b, d, c, sum=1; 
clrscr();    a = 0;   b = 1; 
 cout << "Enter the number of terms\n";   
cin << n;
   for (c=0;c < n;c++ ) 
 {      if (c<=1) d = c;      else      { d = a + b;        sum=d+sum; a = b; b = d;      }      cout << d << "\n";         }      cout << "\n" << sum; getch();      }
0