Advertisement
MeehoweCK

Untitled

Jun 30th, 2021
690
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. // Program wypisujący wszystkie liczby naturalne mniejsze od podanej liczby za pomocą pętli while
  6.  
  7. int main()
  8. {
  9.     cout << "Podaj liczbe naturalna: ";
  10.     int liczba;
  11.     cin >> liczba;
  12.  
  13.     int i = 1;
  14.     while(i < liczba)
  15.     {
  16.         cout << i << endl;
  17.         ++i;                // zwiększenie wartości zmiennej i o 1
  18.     }
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement