Question: Declare a Boolean variable named allMatch. Then, read integer numInput from input representing the number of integers to be read next. Use a loop to
Declare a Boolean variable named allMatch. Then, read integer numInput from input representing the number of integers to be read next. Use a loop to read the remaining integers from input. If all of the numInput integers are in the range to inclusive, assign allMatch with true. Otherwise, assign allMatch with false.
Code at the end of main outputs "All match" if allMatch is true or "Values out of range" if allMatch is false.
Ex: If the input is:
then the output is:
Values out of range #include
using namespace std;
int main
int numInput;
Additional variable declarations go here
Your code goes here
if allMatch
cout "All match" endl;
else
cout "Values out of range" endl;
return ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
