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
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
Science,
1 month ago
Math,
1 month ago
Math,
1 month ago
World Languages,
3 months ago
Math,
9 months ago