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 / bala c king

#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 ?    35 Yes 14 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of ?

993


Is it possible to have a function as a parameter in another function?

1038


There is a practice in coding to keep some code blocks in comment symbols than delete it when debugging. How this affect when debugging?

1243


What does d mean?

1018


Can one function call another?

1051


What is difference between stdio h and conio h?

1325


What are the advantage of c language?

1004


What is the use of a static variable in c?

1008


What are the string functions? List some string functions available in c.

948


Here is a good puzzle: how do you write a program which produces its own source code as output?

1036


What is memcpy() function?

1047


How can I handle floating-point exceptions gracefully?

1108


hi send me sample aptitude papers of cts?

2106


Can we compile a program without main() function?

1076


What are the types of data types and explain?

1035