Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int sum = 0;
- // sum values from 50 through 100 inclusive.
- for (int val = 50; val <= 100; ++val)
- sum += val; // equivalent to sum = sum + val
- cout << "The sum of 50 to 100 inclusive is " << sum << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement