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 a static variable in c?
What are the disadvantages of c language?
Compare interpreters and compilers.
When can you use a pointer with a function?
What is the data segment that is followed by c?
What are the 4 types of organizational structures?
Write a program to swap two numbers without using third variable?
What does != Mean in c?
Tell us something about keyword 'auto'.
Is c is a low level language?
Is c compiled or interpreted?
Explain what is wrong with this program statement?
can anyone please tell about the nested interrupts?
can we implement multi-threads in c.
code for quick sort?