Java program to print the series 1 + (1*2) + (1*2*3) + (1*2*3*n)
Answers
Answered by
1
Answer:
first enter value of n
Explanation:
import java. util. Scanner;
public class series
{
public static void main ()
{
Scanner in = new Scanner(System. in);
System.out.println ("enter the value of n");
double p = 1; int sum = 0;
for(int i = 1; i <= n ; i++)
{
p = p*i;
sum = sum+p;
}
System.out.println(sum);
}
}
Answered by
0
Answer:
you are not helping to me that is not good habit plz help other
Similar questions