Computer Science, asked by sanafatima1d, 4 months ago

Write a java program to find the sum of the given series:
1!+2!+3!+...10!​

Answers

Answered by pragatibhatt2922
2

Answer:

Explanation:

import java.util.Scanner;  

class example  

{  

public static void main(String args[])  

{  

 Scanner in=new Scanner(System.in);  

 System.out.print("Enter limit of series : ");  

 int limit=in.nextInt();  

 int i=1,j=1;  

 long result=0;  

 while(i<=limit)  

 {  

  j=1;  

  while(j<=i)  

  {  

   result=result+j;  

   j++;  

  }  

  i++;  

 }  

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

}  

}

Similar questions