In coral, write a program that first gets a list of five integers from input. Then, get another value from the input, and output all integers less than or equal to that value. Example is the input is 50 60 140 200 75 100, the output is 50 60 75. For coding simplicity, follow every output value by space, including the last one. Then, output a new line. Such functionality is common on sites like Amazon, where users can filter results.
integer array(5) nums
integer filter
integer i
for i = 0; i < nums.size; i = i + 1
nums[i] = Get next input
filter = Get next input
for i = 0; i < nums.size; i = i + 1
if nums[i]<=filter
Put nums[i] to output
Put " " to output
Put "\n" to output
Get Answers For Free
Most questions answered within 1 hours.