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
Physics,
1 day ago
Computer Science,
1 day ago
Biology,
3 days ago
Accountancy,
3 days ago
Computer Science,
8 months ago
English,
8 months ago