180k views
3 votes
Which value can be entered to cause the following code segment to display the message "That number is acceptable."? ____.

intnumber;
cin>> number;
if (number > 10 && number < 100)
cout << "That number is acceptable.\\";
else
cout << "That number is not acceptable.\\";

a) 0
b) 10
c) 99
d) 100
e) All of these

1 Answer

4 votes

Answer:

C) 99

Step-by-step explanation:

This code only displays "That number is acceptable" when such number is higher than 10 and less than 100. This is becasue the conditional sentence if controls which message is going to be displayed based on the abovementioned condition. 0 and 10 are not greater than 10, so they don't pass the condition and 100 is not less than itself, so it does not pass either. The only number among the options greater than 10 and less than 100 is 99.

User Ateiob
by
5.9k points