Answer to Question #15050 in C++ for Sila

Question #15050
3. Write a C++ program that will output the following numbers (using do-while loop).

1, 2, 4, 7, 11, 16, 22, 29, 37, 46, 56
1
Expert's answer
2012-10-04T10:56:03-0400
#include<iostream>

using namespace std;

void
main()
{
int n=0;
int result=1;
cout<<"Numbers are:
\n";
do{
result+=n;
cout<<result<<"\n";
n++;
}while(n<=10)
;
int k;
cin>>k;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS