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
What is equivalent to ++i+++j?
Write the control statements in C language
What is the data segment that is followed by c?
What are the features of c language?
What is memcpy() function?
Can a variable be both constant and volatile?
Is c easier than java?
Explain what will the preprocessor do for a program?
Is c programming hard?
What are structures and unions? State differencves between them.
What does 3 periods mean in texting?
Is struct oop?
What is c language in simple words?
Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the maximum number of concurrent threads that the InnoDB plug-in can create.
In which header file is the null macro defined?