PiotrJurek

Zad11

Mar 29th, 2020
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int SILNIA(int n)
  6. {
  7. int wynik = 1;
  8. do
  9. {
  10. wynik*=n;
  11. n--;
  12. }
  13. while(n>0);
  14. return wynik;
  15. }
  16.  
  17. int main()
  18. {
  19. cout << SILNIA(5) << endl;
  20. cout << SILNIA(0) << endl;
  21. cout << SILNIA(7) << endl;
  22. return 0;
  23. }
Add Comment
Please, Sign In to add comment