write a program that finds the factorial of a number using
recursion?
Answer Posted / priyanka
# include <stdio.h>
main()
{
int n,f,fact;
clrscr();
printf("Enter a no.....");
scanf("%d",&n);
f=fact(n);
printf("Factorial is :%d",f);
}
int fact(int n)
{
if(n<=1)
return 1;
else
n=n*fact(n-1);
return n;
}
getch();
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
Define circular linked list.
What is pointer in c?
What are external variables in c?
Explain is it better to bitshift a value than to multiply by 2?
What are extern variables in c?
Explain what is the difference between functions abs() and fabs()?
Write a function which takes as parameters one regular expression(only ? and * are the special characters) and a string and returns whether the string matched the regular expression.
What is %s and %d in c?
How many header files are in c?
What is wrong in this statement?
can we implement multi-threads in c.
How to draw the flowchart for structure programs?
Why do we need arrays in c?
What header files do I need in order to define the standard library functions I use?
Write a Program to find whether the given number or string is palindrome.