Count Odd Numbers in Interval Range Problem

Count Odd Numbers in Interval Range Problem — ExecCode School DSA Practice

Solve the Count Odd Numbers in Interval Range problem on ExecCode. Free online school DSA practice in Math. Write and run code in Java, C++, Python — no signup required to run.

Problem description

Given a range defined by two integers, low and high, count how many odd numbers exist within this inclusive range. Your task is to understand the rule and print the correct answer. You are working on Count Odd Numbers in Interval Range.

Examples

Input 3 7; Output 3. Input 8 10; Output 1

Constraints

1 <= n <= 10^4

Practice Count Odd Numbers in Interval Range free on ExecCode. Browse DSA problems, topic map, and placement guides.