60 617
Assignments Done
97,8%
Successfully Done
In April 2018

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
Expert's answer
#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 first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions