We are hiring content writers to work from home

Resources » Articles/Knowledge Sharing » Computer & Technology

# C program of finding factorial by using recursion

 Posted Date: 15-Mar-2008 Last Updated: 15-Mar-2008 Category: Computer & Technology Author: ashish singh Member Level: Gold Points: 3

/* Calculate factorial by using recursion */
#include
#include

int fact(int k)
{
if(k==0)
return 1;
else
return k*fact(k-1);
}

void main()
{
int n;
clrscr();
printf("\n Enter a number :");
scanf("%d",&n);
printf("\n Factorial value=%d",fact(n));
getch();
}

Output:
Enter a number :6
Factorial value=720

Did you like this resource? Share it with your friends and show your love!

Responses to "C program of finding factorial by using recursion "
Guest Author: Nilesh M     08 Mar 2013
program of factorial in c using class and its sample is very nice, I like this article and site - good piece of work here. thanks

Feedbacks

## Post Comment:

• Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
• No HTML formatting and links to other web sites are allowed.
• This is a strictly moderated site. Absolutely no spam allowed.
•  Name: Sign In to fill automatically. Email: (Will not be published, but required to validate comment) Type the numbers and letters shown on the left.

 Next Resource: C program to read and print the element of matrix using pointer Previous Resource: C program the value of x^y using recursion Return to Resources Post New Resource Category: Computer & Technology

Post resources and earn money!

More Resources
 Popular Tags Tag posting guidelines Search Tags

### Subscribe to Email

• Get Jobs by Email
• Forum posts by Email
• Articles by Email