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

#include<stdio.h>

main()

{

int a, fact;



printf("\nEnter any number: ");

scanf ("%d", &a);



fact=rec (a);

printf("\nFactorial Value = %d", fact);



}


rec (int x)

{

int f;



if (x==1)

return (1);

else

f=x*rec(x-1);



return (f);

}

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the scope of static variable in c?

944


formula to convert 2500mmh2o into m3/hr

942


Calculate 1*2*3*____*n using recursive function??

1982


In a switch statement, explain what will happen if a break statement is omitted?

997


What is a dynamic array in c?

1072


What is derived datatype in c?

1039


What is data structure in c language?

1057


What is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?

1169


Explain what standard functions are available to manipulate strings?

1025


Why can’t constant values be used to define an array’s initial size?

1325


Explain why c is faster than c++?

1005


a number whose only prime factors are 2,3,5, and 7 is call humble number,,write a program to find and display the nth element in this sequence.. sample input : 2,3,4,11,12,13, and 100.. sample output : the 2nd humble number is 2,the 3rd humble number is 3,the 4th humble number is ,the 11th humble number is 12, the 12th humble number is 14, the 13th humble number is 15, the 100th humble number is 450.

5001


Explain the use of keyword 'register' with respect to variables.

969


What is include directive in c?

1092


disply the following menu 1.Disply 2.Copy 3.Append; as per the menu do the file operations 4.Exit

2018