0% found this document useful (16 votes)
2K views1 page

6.26 LAB Elements in A Range

The program takes a list of integers as input followed by two integers representing the lower and upper bounds of a range. It outputs the integers from the initial list that fall within or equal to the given range bounds, separated by spaces. In the example input listed, the output would be 25 0 33, as those are the integers between 0-50 inclusive from the original list of 25 51 0 200 33.

Uploaded by

CHRIS D
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (16 votes)
2K views1 page

6.26 LAB Elements in A Range

The program takes a list of integers as input followed by two integers representing the lower and upper bounds of a range. It outputs the integers from the initial list that fall within or equal to the given range bounds, separated by spaces. In the example input listed, the output would be 25 0 33, as those are the integers between 0-50 inclusive from the original list of 25 51 0 200 33.

Uploaded by

CHRIS D
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

6.

26 LAB Elements in a range


Write a program that first gets a list of integers from input. That list is followed by two more
integers representing lower and upper bounds of a range. Your program should output all
integers from the list that are within that range (inclusive of the bounds).
Ex: If the input is:
25 51 0 200 33
0 50
the output is:
25 0 33
The bounds are 0-50, so 51 and 200 are out of range and thus not output.
For coding simplicity, follow each output integer by a space, even the last one. Do not end
with newline.
6.26 LAB: Elements in a range

Write a program that first gets a list of integers from input. That list is followed by two more integers representing lower
and upper bounds of a range. Your program should output all integers from the list that are within that range (inclusive
of the bounds).

Ex: If the input is:

25 51 0 200 33

0 50

the output is:

25 0 33

The bounds are 0-50, so 51 and 200 are out of range and thus not output.

For coding simplicity, follow each output integer by a space, even the last one. Do not end with newline.

You might also like