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

#include<stdio.h>
void main()
{
int factorial(int);
int n;
printf("Enter a number: ");
scanf("%d",&n);
printf("Factorial of %d is: %d",n,factorial(n));
}
int factorial(int f)
{
int fact;
if(f==1)
return(1);
else
fact=f*factorial(f-1);
return(fact);
}

Is This Answer Correct ?    13 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

#include { printf("Hello"); } how compile time affects when we add additional header file .

1909


Is struct oop?

1018


hi any body pls give me company name interview conduct "c" language only

2290


Differentiate between functions getch() and getche().

1060


Difference between MAC vs. IP Addressing

1156


about c language

2029


Is there any demerits of using pointer?

1076


What are extern variables in c?

999


What are disadvantages of C language.

1168


Are pointers really faster than arrays?

1040


plz let me know how to become a telecom protocol tester. thank you.

2195


How can you avoid including a header more than once?

989


what is event driven software and what is procedural driven software?

2591


What do you mean by a sequential access file?

1089


What are the 4 types of unions?

1047