write a program that finds the factorial of a number using
recursion?
Answer Posted / meenakshi
#include<stdio.h>
#include<conio.h>
void main()
{
int factorial(int);
int n;
clrscr();
printf("Enter a number: ");
scanf("%d",&n);
printf("Factorial of %d is: %d",n,factorial(n));
getch();
}
int factorial(int f)
{
int fact;
if(f==1)
return(1);
else
fact=f*factorial(f-1);
return(fact);
}
Is This Answer Correct ? | 17 Yes | 8 No |
Post New Answer View All Answers
Write a program, where i have a grid with many cells, how many paths are possible from one point to other desired points.
Explain high-order bytes.
Why c is faster than c++?
How can this be legal c?
Are pointers integer?
write a c program to find the largest and 2nd largest numbers from the given n numbers without using arrays
Why is sprintf unsafe?
What are the 5 types of inheritance in c ++?
What is scope rule in c?
Why C language is a procedural language?
explain what is a newline escape sequence?
explain what is an endless loop?
What are the __date__ and __time__ preprocessor commands?
Explain the difference between exit() and _exit() function?
what is reason of your company position's in india no. 1.