60 469
Assignments Done
98,1%
Successfully Done
In April 2018

Answer to Question #57640 in C++ for Sajid 2

Question #57640
Q. Write a program to display the following formate using while loop:
Num sum
1 1
2 3
3 6
4 10
5 15
Expert's answer

Solution

#include <iostream>
using namespace std;
void main()
{
int sum=0;
for(int i=1;i<=5;i++)
{
sum+=i;
cout<<i<<' '<<sum<<endl;
}
}

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