Advertisement
Lukasz_Miskiewicz

Zadanie 16

Mar 31st, 2020
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int a,b,c;
  4.  
  5. void dzielniki(int d)
  6. {
  7. int a=1;
  8. while(a<=d)
  9. {
  10. if(d%a==0)
  11. {
  12. cout<<a<<" ";
  13. }
  14. a++;
  15. }
  16. }
  17.  
  18. int main()
  19. {
  20. cout<<"Podaj jedna liczbe naturalna"<<endl;
  21. cin>>a;
  22. cout<<"dzielniki tej liczby to"<<endl;
  23. dzielniki(a);
  24.  
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement