Advertisement
Guest User

1.13a

a guest
Feb 6th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int sum = 0;
  8.     // sum values from 50 through 100 inclusive.
  9.     for (int val = 50; val <= 100; ++val)
  10.         sum += val;  // equivalent to sum = sum + val
  11.     cout << "The sum of 50 to 100 inclusive is " << sum << endl;
  12.  
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement