Advertisement
LukaszPanko

Zadanie 16

Mar 29th, 2020
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5.  
  6. void DZIELNIK(int l)
  7. {
  8.     for(int i=1;i<=l;i++){
  9.         if(l%i==0){
  10.             cout <<i<<" ";
  11.         }
  12.     }
  13. }
  14.  
  15. int main()
  16. {
  17.     int liczba;
  18.     cout << "Podaj liczbe ktorej dzielniki chcesz poznac: " ;
  19.     cin >> liczba;
  20.     cout<<"Dzielniki liczby " << liczba << " to: ";
  21.     DZIELNIK(liczba);
  22.  
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement