beyondgrader.com Logo
DemoBrowseAboutTeamLogin

Odd Range Sum

Geoffrey Challen // 2020.9.0

Write a snippet of code (not a function) that prints the sum of all odd integers between start and end, inclusive, int variables that have been declared and initialized already. So you should start at start and include all odd numbers up to and including end. You can test if a number is even by using the remainder operator: n % 2 == 0.