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

#include<stdio.h>
int n_fact(int n);
void main()
{
int n,res=0;
printf("ENTER A NUMBER:-");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
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 ?    8 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain About fork()?

1113


What is pivot in c?

1026


What do you know about the use of bit field?

1045


Why does this code crash?

1091


Hai sir, I had planned to write the NIC scientific engineer exam , plz post the sample question......

2187


What is substring in c?

1204


What is far pointer in c?

1308


Why is c called "mother" language?

1284


what is recursion in C

1060


How can I read in an object file and jump to locations in it?

1027


Is c dynamically typed?

1152


Can a variable be both static and volatile in c?

1036


What is the scope of global variable in c?

990


What are the applications of c language?

1075


Was 2000 a leap year?

1049