Advertisement
Josif_tepe

Untitled

May 22nd, 2024
474
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.27 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     int a, b, x, y;
  7.     x = 0; y = 0;
  8.     a = 1; b = 2;
  9.     do
  10.     {
  11.         x = x + a; // 3
  12.         y = y + b; // 4
  13.         a++;
  14.     } while(a <= b);
  15.     cout << x << endl;
  16.     cout << y << endl;
  17.  
  18. }
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement