Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- using namespace std;
- int liczba1;
- int SILNIA(int a)
- {
- if(a<2)
- {
- return 1;
- }
- return a*SILNIA(a-1);
- }
- int main()
- {
- cout << "Podaj liczbe naturalna: ";
- cin >> liczba1;
- cout << "Silnia z liczby !" << liczba1 << " wynosi: " << SILNIA(liczba1);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement