0

anyone please correct me with this example

int factorial(int n) { if (n==1) { return 1; } else { return n * factorial(n-1); } } int main(){ cout << factorial; system("pause"); return 0; } what if I put the value of n==4?

13th Aug 2020, 7:03 PM
Shubhankar Mishra
Shubhankar Mishra - avatar
1 Réponse
+ 5
cout<<factorial(4);
13th Aug 2020, 7:08 PM
Midhun Madhu
Midhun Madhu - avatar