Advertisement
MeehoweCK

Untitled

Jul 6th, 2021
1,019
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.25 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int n, liczba = 2;
  8.     cout << "Podaj liczbe naturalna: ";
  9.     cin >> n;
  10.  
  11.     while(liczba < n)
  12.     {
  13.         cout << liczba << ' ';
  14.         liczba *= 2;
  15.     }
  16.  
  17.     return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement