# Find sum of series (1+(1*2)+(1*2*3)+...till N)

## Problem statement:- Program to find the sum of series (1+(1*2)+(1*2*3)+...till N).

#### Sample Input/Output:-

 Sample Input First:7 Sample Output First: 5913 Sample Input Second: 8 Sample Output Second: 46233

Data requirement:-

Input Data:- n

Output Data:- sum_series

Program in C

Code:

### ``#include <stdio.h>int main(){  int n, i = 1,sum_series= 0;  /* Get the N Value */  printf("Enter the range of number:");  scanf("%d", &n);  while (i <= n)  {    int multiply= 1,j;    for (j = 1; j <= i; j++)    {      multiply*= j;    }    sum_series += multiply;    i++;  }  printf("The sum of the series = %d", sum_series);}``

Input/Output:
Enter the range of number:7
The sum of the series = 5913

Program in C++

Code:

### ``#include <iostream>#include <cmath>using namespace std;int main(){    int n, i = 1, sum_series = 0;    /* Get the N Value */    cout << "Enter the range of number:";    cin >> n;    while (i <= n)    {        int multiply = 1, j;        for (j = 1; j <= i; j++)        {            multiply *= j;        }        sum_series += multiply;        i++;    }    cout << "The sum of the series = " << sum_series;}``

Input/Output:
Enter the range of number:8
The sum of the series = 46233

Program in Java

Code:

### ``import java.util.Scanner;public class SumOfSeries {    public static void main(String[] args) {        Scanner cs = new Scanner(System.in);        int n, i = 1, sum_series = 0;        /* Get the N Value */        System.out.println("Enter the range of number:");        n = cs.nextInt();        while (i <= n) {            int multiply = 1, j;            for (j = 1; j <= i; j++) {                multiply *= j;            }            sum_series += multiply;            i++;        }        System.out.println("The sum of the series = " + sum_series);        cs.close();    }}``

Input/Output:
Enter the range of number:
9
The sum of the series = 409113

Program in Python

Here is the source code of the Python Program to find the sum of series (1+(1*2)+(1*2*3)+...till N).

Code:

### ``# Get the N Value n=int(input("Enter the range of number:"))sum_series=0i=1while(i<=n):    multiply=1    for j in range(1,i+1):        multiply*=j    sum_series+=multiply    i+=1print("The sum of the series = ",sum_series)``

Input/Output:
Enter the range of number:
11
The sum of the series =  43954713