KarolWozniak

Zadanie 16

Mar 31st, 2020
151
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 liczba1;
  6.  
  7. void DZIELNIKI(int a)
  8. {
  9.     int i=1;
  10.     while(i<=a)
  11.     {
  12.         if(a%i==0)
  13.         {
  14.             cout << i << " ";
  15.         }
  16.  
  17.         i++;
  18.     }
  19. }
  20.  
  21. int main()
  22. {
  23.     cout << "Podaj liczbe naturalna: ";
  24.     cin >> liczba1;
  25.     DZIELNIKI(liczba1);
  26.     return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment