Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Announcements 2016F x M Tinyscanner test 1 -hdg x C Chegg Study I Guided Sc x ht

ID: 3572519 • Letter: A

Question

Announcements 2016F x M Tinyscanner test 1 -hdg x C Chegg Study I Guided Sc x https:// mail.google.com/mai inbox /158cd3bbBae817c5?projecto Apps Bookmarks Psychology Clep Stud Sca COMPOSE Problem 4) Wnte a program with the inputs is n where n is the nth number in Fibonaoca vequence. and output the summation of all the numbers mum 1 n custom in the command window or script, run the functon worth dnement values ofn business your oode isoluutakon 10 Wres of code) (tests loops) t Sudoku Extm Show all X 10:33 PM Desktop A 12/4/2016 Search the web and Windows

Explanation / Answer

main.cpp

#include <iostream>
using namespace std;

int main()
{
    int i,no, first=0, second=1, next,sum=0;
first=0;
second=1;
cout<<"Enter nubmer of terms for Series: "<<endl;
cin>>no;
cout<<"Fibonacci series are: ";
for(i=0; i<no; i++)
{
cout<<first<<" ";
sum=sum+first;
next = first + second;
first = second;
second = next;

}
cout<<endl<<"sum = "<<sum;
    return 0;
}

Output :-

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote