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

#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 ?    197 Yes 32 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does c mean in standard form?

1101


how can f be used for both float and double arguments in printf? Are not they different types?

1014


which is an algorithm for sorting in a growing Lexicographic order

1747


When should a type cast not be used?

1005


What are the 4 types of functions?

996


Explain what are the __date__ and __time__ preprocessor commands?

1073


What's the right way to use errno?

1087


What is a far pointer in c?

991


Is stack a keyword in c?

1038


How do I round numbers?

958


What is the incorrect operator form following list(== , <> , >= , <=) and what is the reason for the answer?

1383


a formula,a series of steps,or well defined set of rules for solving a problem a) algorithem b) program c) erdiagram d) compiler

1023


a function gets called when the function name is followed by a a) semicolon (;) b) period(.) c) ! d) none of the above

1328


Write a programme using structure that create a record of students. The user allow to add a record and delete a record and also show the records in ascending order.

2039


Is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?

1034