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