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 are the types of functions in c?

989


In this assignment you are asked to write a multithreaded program to find the duplicates in an array of 10 million integers. The integers are between -5000,000 to 5000,000 and are generated randomly. Use 10 threads, each thread works on 1000,000 integers. Compare the time needed to accomplish the task with single thread of execution program. Do not include the time to fill the array with integers in the execution time.

3122


How do you determine a file’s attributes?

1088


Is null equal to 0 in sql?

1151


what is the difference between north western polytechnique university and your applied colleges?? please give ur answers for this. :)

2413


How is pointer initialized in c?

1027


What is the collection of communication lines and routers called?

1128


Write a C program to count the number of email on text

1921


What are the uses of a pointer?

1153


Why enum is used in c?

962


What is memcpy() function?

1122


Write a code to determine the total number of stops an elevator would take to serve N number of people.

1259


How can I dynamically allocate arrays?

1104


What is echo in c programming?

1029


When should volatile modifier be used?

1015