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

EzraEzra
Faith is not about having all the answers, but learning to ask the right questions.
Chat with Ezra
RossRoss
Every question is just a happy little opportunity.
Chat with Ross
JordanJordan
Looking for a career mentor? I've seen my fair share of shake-ups.
Chat with Jordan

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