Answer in C language! 5.20 LAB: Output values below an amount Instructor note: Although the size of the array is defined

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Answer in C language! 5.20 LAB: Output values below an amount Instructor note: Although the size of the array is defined

Post by answerhappygod »

Answer in C language! 5.20 LAB: Output values below anamount
Instructor note:
Although the size of the array is defined by the constantNUM_ELEMENTS, the constant is not used anywhere else in theprogram's solution. And, if you were to copy the code into VisualStudio, you will have to change the size of the array to use theliteral number 20 instead of the constant.
Write a program that first gets a list of integers from input.The input begins with an integer indicating the number of integersthat follow. Then, get the last value from the input, whichindicates a threshold. Output all integers less than or equal tothat last threshold value. Assume that the list will always containless than 20 integers.
Ex: If the input is:
the output is:
The 5 indicates that there are five integers in the list, namely50, 60, 140, 200, and 75. The 100 indicates that the program shouldoutput all integers less than or equal to 100, so the programoutputs 50, 60, and 75.
For coding simplicity, follow every output value by a comma,including the last one.
Such functionality is common on sites like Amazon, where a usercan filter results.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply