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...

plz answer..... a program that reads non-negative integer
and computes and prints its factorial

Answer Posted / valli

//using recursion
fact(int);
main()
{
int n;
printf("enter n");
scanf("%d",n)
if(n<0)
printf("invalid number");
else
printf("factorial of %d =%d",n,fact(n));
}
fact(int n)
{
if(n==0||n==1)
return 1;
else
return n*fact(n-1);
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Do you know what are bitwise shift operators in c programming?

1091


Is c object oriented?

958


how to build a exercise findig min number of e heap with list imlemented?

2068


What is the newline escape sequence?

1069


What is the use of ?

1030


Does * p ++ increment p or what it points to?

1113


Why doesnt that code work?

1163


Linked lists -- can you tell me how to check whether a linked list is circular?

1074


Do you have any idea how to compare array with pointer in c?

1043


I was asked to write a program in c which when executed displays how many no.of clients are connected to the server.

2363


Can you write the function prototype, definition and mention the other requirements.

1120


What is type qualifiers?

1126


Iam a B.Tech graduate and completed my engineering in 2009, from 2005 to 2009 and after that i had done nothing.Now i want to do job and get into BPO field . Friends give me suggestions as what to say in interview... if they ask me that what would you had done ... these many years without doing job ??????? pls urgent

1814


Who invented bcpl language?

1187


Is c easier than java?

1059