Computer Science, asked by thar20128eirmkecacin, 3 months ago

An integer N is passed as the input to the program. The program must calculate the sum of all the
odd integers from 1 to Nas oddSum and calculate all the even integers from 1 to N as evenSum.
Then the program must print the oddsum, evenSum and the absolute difference of oddSum and
evensum as the output.​

Answers

Answered by Ankur12123
1

Answer:

An integer N is passed as the input to the program. The program must calculate the sum of all the

odd integers from 1 to Nas oddSum and calculate all the even integers from 1 to N as evenSum.

Then the program must print the oddsum, evenSum and the absolute difference of oddSum and

evensum as the output.

Similar questions