Question
Given two integers, l, and r, print all the odd numbers between l and r (l and r inclusive) Complete the oddNumbers function: It has
Given two integers, l, and r, print all the odd numbers between l and r (l and r inclusive)
Complete the oddNumbers function: It has 2 parameters:
1. An integer l, denoting the left part of the range.
2. An integer r, denoting the right part of the range.
The function must return an array of integers denoting the odd numbers between l and r.
Input Format:
Read the following input:: the first line contains an integer, l, denoting the left part of the range.
The second line contains an integer, r, denoting the right part of the range.
Constraints:
1<_l<_r<_10^5
Output Format: The function must return an array of integers denoting the odd numbers between l and r.
Sample Input 0: 2,5
Sample Output 0
Explanation 0: The value of l is 2 and the value of r is 5. The odd numbers between [2,5] are 3 and 5.
Please code in java, javascript, c, or C++. I have tried but have gotten nowhere with this problem
Thank you
Step by Step Solution
3.46 Rating (156 Votes )
There are 3 Steps involved in it
Step: 1
OddNumberPrintjava package oddnumberprint import javautilScan...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started