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

/* A.Yamuna III BSC CS L.R.G. College , Tirupur*/
#include<stdio.h>
#include<conio.h>
void main()
{
int a,n;
int sum=1;
int total=0;
clrscr();
printf("Enter the number :");
scanf("%d",&n);
for(a=1;a<=n;a++)
{
for(int i=1;i<=a;i++)
{
sum=sum*i;
}
total=total+sum;
sum=1;
}
printf("The factorial is :%d",total);
getch();
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a substring in c?

1032


What is a wrapper function in c?

1115


What is unary operator?

1098


What is function pointer c?

1107


How can I manipulate strings of multibyte characters?

1111


all c language question

2432


What is the value of uninitialized variable in c?

1031


Why is structure padding done in c?

1129


What is a global variable in c?

1003


What is the difference between mpi and openmp?

1287


Explain what is page thrashing?

1094


Can the sizeof operator be used to tell the size of an array passed to a function?

1114


When should the volatile modifier be used?

1170


Is c pass by value or reference?

1033


How we can insert comments in a c program?

1119