+ 2

What is wrong in the following code ?

recursive function to find factorial of a number, https://code.sololearn.com/cxBdSJ4H1E9A/?ref=app

11th Nov 2018, 12:20 PM
Abhay
Abhay - avatar
3 Respuestas
+ 9
in print you forget the %d for printing factorial. Should be 2 %d one for n and another for factorial.
11th Nov 2018, 12:30 PM
Anya
Anya - avatar
+ 8
It's all good, just change line 8 to printf("factorial of %d is %d", n, factorial); 😊
11th Nov 2018, 12:25 PM
Kishalaya Saha
Kishalaya Saha - avatar
+ 3
hmm, I was stuck there only thinking something was wrong just cudn't figured it out so thought about asking ,thks Anya and kishalaya
11th Nov 2018, 12:42 PM
Abhay
Abhay - avatar