Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdlib>
- #include <iostream>
- using namespace std;
- int fattoriale (int n)
- {
- if (n <= 1)
- return 1;
- else
- return n * fattoriale(n - 1);
- }
- int main(int argc, char *argv[])
- {
- int fatt;
- cout << "inserire fatt : " << endl;
- cin >> fatt;
- cout << fattoriale(fatt) << endl;
- system("pause >null");
- return EXIT_SUCCESS;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement