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 ternary operator in c?

1130


What are the 5 types of organizational structures?

1085


When do you not use the keyword 'return' when defining a function a) Always b) Never c) When the function returns void d) dfd

1068


What is the advantage of c?

1134


What happens if header file is included twice?

1154


Why do we need arrays in c?

1164


simple program of graphics and their output display

2007


Can we assign integer value to char in c?

1263


What is assert and when would I use it?

1020


Do you know the difference between exit() and _exit() function in c?

1066


What is #include stdio h?

1130


What are the application of void data type in c?

1195


What is the difference between a function and a method in c?

1095


What is a function simple definition?

1105


Write a program to swap two numbers without using the third variable?

1078