Which value can be entered to cause the following code segment to display the message "That number is acceptable."
int number
cin >> number;
if (number > 10 && number < 100)
cout << "That number is acceptable.";
else
cout << "That number is not acceptable."

Respuesta :

Answer:

We can give the any  integer value between 10 to 100 then it display the message "That number is acceptable."

Explanation:

In the given code the "number" variable takes an user input via cin .After taking user input it check the condition of if block that the user input is between the range of 10 to 100 .if this condition is true then the statement of if block will be executed i.e  That number is acceptable otherwise else block will be executed That number is not acceptable.

following are the code in c++

#include <iostream> // header file

using namespace std;

int main() // main

{  

   int number; // variable

cin >> number; // taking input

if (number > 10 && number < 100) // if block

cout << "That number is acceptable.";

else

cout << "That number is not acceptable.";

return 0;

}

Output:

66

That number is acceptable.

456

That number is not acceptable.

Otras preguntas