answersLogoWhite

0

/*program to find the factorial of a given number*/

#include<stdio.h>

#include<conio.h>

int fact(int);

void main()

{

int n,c;

printf("\n enter the number for which you want to find the factorial");

scanf("%d",&n);

c=fact(n);

printf("\n the factorial of the number %d is %d",n,fact);

getch();

}

int fact(int n)

{

int k;

if(n==0)

return(1);

else

k=n*fact(n-1);

return(k);

}

User Avatar

Wiki User

14y ago

Still curious? Ask our experts.

Chat with our AI personalities

JudyJudy
Simplicity is my specialty.
Chat with Judy
ReneRene
Change my mind. I dare you.
Chat with Rene
CoachCoach
Success isn't just about winning—it's about vision, patience, and playing the long game.
Chat with Coach

Add your answer:

Earn +20 pts
Q: Program to find the factorial of a number using recursion?
Write your answer...
Submit
Still have questions?
magnify glass
imp