Kotlinlearncs.online LogoJava
Return to List

Solve: Odd Range Sum

Created By: Geoffrey Challen
/ Version: 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.

Related Lessons

Stuck? You may find these lessons helpful: