Advertisement
vencinachev

Loop2

Feb 20th, 2021
1,006
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int s = 10;
  8.     int i = 0;
  9.     int broi = 0;
  10.  
  11.     do
  12.     {
  13.         broi++;
  14.         s = s + i;
  15.         i = i + 1;
  16.     }
  17.     while (i > 10);
  18.  
  19.     cout << "s = " << s << endl;
  20.     cout << "i = " << i << endl;
  21.     cout << "Broi = " << broi << endl;
  22.     return 0;
  23. }
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement