Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include "iostream"
- using namespace std;
- int fact(int x)
- {
- if (x != 1)
- {
- return fact(x-1)*x;
- }
- }
- int main()
- {
- int n;
- cin >> n;
- cout << fact(n);
- cin >> n;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment