Answer to Question #30598 in C++ for saleshni
Formula for adding numbers from 1 to 100 in C++ programme
1
2013-05-17T10:09:00-0400
#include <iostream>
using namespace std;
int main() {
int sum = 100 * 101 / 2;
cout << "sum from 1 to 100 is " << 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!
Learn more about our help with Assignments:
C++
Comments
Leave a comment