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
#include
Explain what is operator promotion?
i = 25;switch (i) {case 25: printf("The value is 25 ");case 30: printf("The value is 30 "); When the above statements are executed the output will be : a) The value is 25 b) The value is 30 c) The value is 25 The value is 30 d) none
Explain argument and its types.
Where register variables are stored in c?
Explain what is wrong in this statement?
Why isn't any of this standardized in c? Any real program has to do some of these things.
Explain the use of fflush() function?
What does & mean in scanf?
What is a volatile keyword in c?
What is difference between union and structure in c?
What is .obj file in c?
What is pass by reference in functions?
What are integer variable, floating-point variable and character variable?
What is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?