Page 1 of 1

Write a program that calculates the sum and product of 2, 4, 6, 8,..., n, where n is a user entered even integer value.

Posted: Thu May 05, 2022 1:19 pm
by answerhappygod
Write A Program That Calculates The Sum And Product Of 2 4 6 8 N Where N Is A User Entered Even Integer Value 1
Write A Program That Calculates The Sum And Product Of 2 4 6 8 N Where N Is A User Entered Even Integer Value 1 (20.93 KiB) Viewed 44 times
Write a program that calculates the sum and product of 2, 4, 6, 8,..., n, where n is a user entered even integer value. You will define two methods sumToN[int n) and productToN(int n) that calculate these two values. The following is a sample run: Enter a positive even number: 16 2+4+...+16 = 72 2*4*...*16= 10321920