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

Write a program of advanced Fibonacci series.

1163


What is the use of typedef in structure in c?

978


Explain how do you print an address?

1151


Explain enumerated types in c language?

1059


Why can arithmetic operations not be performed on void pointers?

1053


What is the difference between printf and scanf in c?

1366


What is typedef struct in c?

1060


Tell me about low level programming languages.

1144


What is data type long in c?

1080


Can you please explain the scope of static variables?

1064


Write a program on swapping (100, 50)

1135


How does placing some code lines between the comment symbol help in debugging the code?

1015


What is 2c dna?

1090


What is use of bit field?

1304


What is a null pointer in c?

1242