Answer to Question #15050 in C++ for Sila
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
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!
Learn more about our help with Assignments:
C++
Comments
Leave a comment