Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

write a program that finds the factorial of a number using
recursion?

Answer Posted / asit kumar swain

#include<stdio.h>
#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 n*fact(n-1);
}
}

Is This Answer Correct ?    27 Yes 13 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why do we need volatile in c?

1114


Write a program to print fibonacci series without using recursion?

1062


How do you define structure?

986


what does static variable mean?

1045


which type of aspect you want from the student.

2111


What is nested structure?

993


Implement bit Array in C.

1088


When should I declare a function?

1052


What is a macro, and explain how do you use it?

1014


Why is c known as a mother language?

1182


What happens if header file is included twice?

1088


What is the Purpose of 'extern' keyword in a function declaration?

1029


Why main is not a keyword in c?

1172


how can i access hard disk address(physical address)? are we access hard disk by using far,near or huge pointer? if yes then please explain.....

1738


Write a program to check prime number in c programming?

1026