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


Please Help Members By Posting Answers For Below Questions

What is a static variable in c?

668


What are the disadvantages of c language?

622


Compare interpreters and compilers.

639


When can you use a pointer with a function?

568


What is the data segment that is followed by c?

614






What are the 4 types of organizational structures?

625


Write a program to swap two numbers without using third variable?

814


What does != Mean in c?

590


Tell us something about keyword 'auto'.

666


Is c is a low level language?

566


Is c compiled or interpreted?

667


Explain what is wrong with this program statement?

621


can anyone please tell about the nested interrupts?

1678


can we implement multi-threads in c.

669


code for quick sort?

1622