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

#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 ?    17 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are qualifiers?

990


what is the format specifier for printing a pointer value?

990


diff between exptected result and requirement?

2014


State two uses of pointers in C?

1025


what does static variable mean?

1070


What is the purpose of the preprocessor directive error?

1219


Which of these functions is safer to use : fgets(), gets()? Why?

1062


Write a program to check palindrome number in c programming?

980


what is a function method?give example?

2333


What is the significance of c program algorithms?

1113


Explain how do you convert strings to numbers in c?

1039


Why do we use c for the speed of light?

1125


Explain how can you check to see whether a symbol is defined?

1117


What is the difference between the expression “++a” and “a++”?

1188


What are logical errors and how does it differ from syntax errors?

1248