Question: Write a program that takes a positive whole number, n, and if n is even, performs the computation suggested by these examples, and prints the
Write a program that takes a positive whole number, n, and if n is even, performs the computation suggested by these examples, and prints the value of the computation. If n is odd, it prints nonsensical input.
| input n | computation | output |
| 4 | (2/2)+(2+4)/4 | 2.5 |
| 6 | (2/2)+(2+4)/4+(2+4+6)/6 | 4.5 |
| 8 | (2/2)+(2+4)/4+(2+4+6)/6+(2+4+6+8)/8 | 7 |
| 3 | nonsensical input |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
