write a program that finds the factorial of a number using
recursion?
Answer Posted / danish
>
#include<conio.h>
int fact(int);
void main()
{
int num,fact1;
clrscr();
printf("Enter a value of num");
scanf("%d",&num);
fact1=fact(num);
printf("factorial=%d",fact1);
}
int fact(int n)
{
if(n==0)
{
return 1;
}
else
{
return
| Is This Answer Correct ? | 13 Yes | 8 No |
Post New Answer View All Answers
What is difference between main and void main?
What are the disadvantages of external storage class?
What does. int *x[](); means ?
What is %s and %d in c?
A c program to display count values from 0 to 100 and flash each digit for a secong.reset the counter after it reaches 100.use for loop,. pls guys hepl me.. :(
What is pointer and structure in c?
What is the explanation for prototype function in c?
What is infinite loop?
State two uses of pointers in C?
How can I make sure that my program is the only one accessing a file?
Describe newline escape sequence with a sample program?
What is unsigned int in c?
write a proram to reverse the string using switch case?
What is the difference between declaring a variable and defining a variable?
Explain why c is faster than c++?