Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Accounting questions

Question

5 . What function is used for the parity disk ( s ) ?

Answered: 1 week ago

Question

1. Let a, b R, a Answered: 1 week ago

Answered: 1 week ago