Computer Science, asked by naazadiba61, 7 months ago

S= 1 ! + 2 ! + 3! + 4 ! + 5 .........
.....n terms ​

Answers

Answered by RuwaisnZaid
0

Explanation:

N = x = int(input("Enter a no"))

fact = 1

for j in range(1,N+1):

u = j

for i in range(1,u+1):

fact = fact *i

print(fact,end="+")

mark me as brainly

Answered by anindyaadhikari13
2

Question:-

Write a program to find the sum of the series.

S=1! +2! +3! +... N!

Program:-

In Java.

import java.util.*;

class Sum

{

public static void main(String args[])

{

Scanner sc=new Scanner(System.in);

System.out.print("Enter the value of N: ");

int n=sc.nextInt();

long s=0L, p=1;

for(int i=1;i<=n;i++)

{

p=p*i;

s+=p;

}

System.out.println("Sum of the given series is: "+s);

/**

* By:- Anindya Adhikari.

*/

}

}

Similar questions