Advertisement
MeehoweCK

Untitled

Sep 10th, 2018
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.26 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int sum = 0;
  8.     for(int i = 1; i < 10; i++)
  9.         sum = sum + i;          // również prawidłowe jest: sum += i;
  10.     return 0;
  11. }
  12.  
  13. // wartość sum na koniec wyniesie 1+2+3+4+5+6+7+8+9 = 45
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement