josiftepe

Untitled

Jan 27th, 2021
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.32 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.    
  6.     int pocetok = 100;
  7.     int kraj = 300;
  8.     int zbir = 0;
  9.     while (pocetok <= kraj) {
  10.         zbir += pocetok;
  11.         pocetok += 1;
  12.     }
  13.     // 100, 102, 104, 106, ... 200
  14.     cout << "Zbirot e ednakov na: " << zbir << endl;
  15.     return 0;
  16. }
  17.  
Advertisement
Add Comment
Please, Sign In to add comment