Ques. Find the sum of the series s = 2 + 4 + 6 + ______+ n terms by using java program . no other answer otherwise it will b reported.
Answers
Answered by
1
Explanation:
Given a positive integer n. The problem is to find the sum of the given series 2 + (2+4) + (2+4+6) + (2+4+6+8) + …… + (2+4+6+8+….+2n), where i-th term in the series is the sum of first i even natural numbers.
Examples:
Input : n = 2
Output : 8
(2) + (2+4) = 8
Input : n = 5
Output : 70
(2) + (2+4) + (2+4+6) + (2+4+6+8) + (2+4+6+8+10) = 70
Similar questions