Factorial using Recursion

Description:

Find the factorial of a given number using recursion Test Case 1 Input (stdin) 5 Expected Output 120 Test Case 2 Input (stdin) 3 Expected Output 6

Program :

#include <iostream>

 using namespace std;

 int main()

 {

 int i,fact=1,number;

 cout<<" ";

cin>>number;

 for(i=1;i<=number;i++){ fact=fact*i; } cout <<" "<<fact<<endl;

 return 0;

 }