What output should I get for this Java program, giving input for both a and n as 2?
Attachments:

Answers
Answered by
0
Answer:
Solution is 3
Explanation:
We know that sum of n series s= a+(n-1)d
Here a=2 n=2 d = distance between a2 and a1
d= 2/1 - 1 = 1
d=1
Therefore s= 2+(2-1)(1)
S=3
Similar questions
Math,
1 month ago
English,
1 month ago
Math,
1 month ago
Biology,
2 months ago
Accountancy,
2 months ago
Computer Science,
10 months ago
English,
10 months ago