#include <iostream>
using namespace std;
void main() // starting point
{
int sum, x;
x = 1;
sum = 0;
while( x <= 10 )//loop for repeating 10 times
{
sum += x;
++x;
}
cout << "The sum is: " << sum << endl;// output point
system("pause");
}
Output
Find Tons of C++ Programming examples, projects with code. Also find books solutions.
0 Questions:
Post a Comment