write variable description table for important the following program
java.util.*;
public class Series3
{
public static void main() {
Scanner in = new Scanner(System.in);
System.out.println("enter your choice\n 1 or 2");
int ch = in.nextInt();
switch(ch) {
case 1:
double sum = 0.0;
for (int i = 2; i <= 20; i+=20) {
System.out.println(i+(i<20?",":""));
}
break;
sum =
I
case 2:
0;
int j = 1;
System.out.print("Enter n: ");
int n = in.nextInt();
System.out.print("Enter a: ");
in.nextInt();
sum = 0.0;
for (int i = 1;i<=n; i++){
sum += Math.pow(j, 2) / Math.pow(a, i);
j+=2;}
System.out.println("Sum = " + sum);
break;
int a =
default:
System.out.println("wrong choice");
}
Answers
Answered by
0
Answer:
very hard Q but you vote me pls and like and follow mw
Similar questions