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 to compute the following
1!+2!+...n!

Answer Posted / ashish

#include<stdio.h>
int n_fact(int n);
void main()
{
int n,res;
printf("ENTER A NUMBER:-");
scanf("%d",&n);
res=n_fact(n);
printf("%d",res);
}
int n_fact(n)
{
int result;
if(n=0)
result=1;
else
result=n*n_fact(n-1);
return(result);
}

Is This Answer Correct ?    5 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how we can make 3d venturing graphics on outer interface

4731


Is c a great language, or what?

1050


What is wrong in this statement?

1080


Can main () be called recursively?

1064


I just typed in this program, and it is acting strangely. Can you see anything wrong with it?

943


How many keywords (reserve words) are in c?

1083


What are near, far and huge pointers?

1013


What are the 5 types of inheritance in c ++?

967


Write a program to show the change in position of a cursor using c

997


What is use of #include in c?

1089


is it possible to create your own header files?

1046


What does 3 periods mean in texting?

1012


Explain the use of function toupper() with and example code?

1078


How can variables be characterized?

2129


An integer that indentifies the position of a data item in a sequence of data items a) value b) number c) index d) all of the above

1152