RafalSobala

zad 11

Mar 30th, 2020
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.28 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int a, wynik=1;
  6.  
  7. int SILNIA(int a){
  8.     for(int i=a; i>0; i--)
  9.     {
  10.     wynik = wynik * i;
  11.     }
  12.     return wynik;
  13. }
  14. int main()
  15. {
  16.     cout << "Podaj a: " << endl;
  17.     cin >> a;
  18.  
  19.     cout << SILNIA(a);
  20.     return 0;
  21. }
Add Comment
Please, Sign In to add comment