S=1+(1*2)+(1*2*3)+.........(1*2*3*4*5*...........20)
write a program to solve this in java language
Answers
Answered by
7
public class Series
{
public static void main(String[] args)
{
int sum = 0, i = 0;
for (int j = 1; j <= 20; j++)
{
for (i = 1; i <= j; i++)
{
sum = sum + i;
}
i = 1;
}
System.out.println("Sum of series = " + sum);
}
}
{
public static void main(String[] args)
{
int sum = 0, i = 0;
for (int j = 1; j <= 20; j++)
{
for (i = 1; i <= j; i++)
{
sum = sum + i;
}
i = 1;
}
System.out.println("Sum of series = " + sum);
}
}
Answered by
2
public class Series
{
public static void main(String[] args)
{
int sum = 0, i = 0;
for (int j = 1; j <= 20; j++)
{
for (i = 1; i <= j; i++)
{
sum = sum + i;
}
i = 1;
}
System.out.println("Sum of series = " + sum);
}
Similar questions
Biology,
8 months ago
English,
8 months ago
Math,
8 months ago
Sociology,
1 year ago
Psychology,
1 year ago
Science,
1 year ago
Computer Science,
1 year ago