Log in to add a comment

## Answers

#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(); }