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 / 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


Please Help Members By Posting Answers For Below Questions

Define circular linked list.

974


What is pointer in c?

1137


What are external variables in c?

1034


Explain is it better to bitshift a value than to multiply by 2?

1135


What are extern variables in c?

944


Explain what is the difference between functions abs() and fabs()?

1097


Write a function which takes as parameters one regular expression(only ? and * are the special characters) and a string and returns whether the string matched the regular expression.

1032


What is %s and %d in c?

970


How many header files are in c?

981


What is wrong in this statement?

1074


can we implement multi-threads in c.

1086


How to draw the flowchart for structure programs?

9246


Why do we need arrays in c?

1076


What header files do I need in order to define the standard library functions I use?

995


Write a Program to find whether the given number or string is palindrome.

1224