Advertisement
Lukasz_Miskiewicz

Zadanie 11

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