Computer Science, asked by dwijakishore, 3 days ago

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

Attachments:

Answers

Answered by bandivijayabharathi
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