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

What is equivalent to ++i+++j?

1088


Write the control statements in C language

1200


What is the data segment that is followed by c?

1081


What are the features of c language?

1066


What is memcpy() function?

1116


Can a variable be both constant and volatile?

1113


Is c easier than java?

1069


Explain what will the preprocessor do for a program?

1063


Is c programming hard?

1015


What are structures and unions? State differencves between them.

1171


What does 3 periods mean in texting?

1054


Is struct oop?

1002


What is c language in simple words?

1068


Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the maximum number of concurrent threads that the InnoDB plug-in can create.

1935


In which header file is the null macro defined?

1341