Question
4.3.4: While loops with numbers. Read integers from input until an integer is read that is not in the range -40 to 35, both exclusive.
4.3.4: While loops with numbers.
Read integers from input until an integer is read that is not in the range -40 to 35, both exclusive. For each integer read that is in the given range, output the integer followed by " is accepted". Then, output the integer read that causes the reading to stop followed by " is rejected". End each output with a newline.
Ex: If the input is -36 -30 -50 -33 -32 -37 -34, then the output is:
-36 is accepted
-30 is accepted
-50 is rejected
#include
int main() { int inputData;
/* Your code goes here */
return 0; }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
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