How to write a C++ program when an integer is entered by user and checks whether it is greater than 8 and less than 10?

0 votes
asked by about Code::Blocks
edited by

1 Answer

0 votes
answered by (99.8k points)

if (number > 8 && number < 10) {
    std::cout << "The number is greater than 8 and less than 10." << std::endl;
} else {
    std::cout << "The number is not in the specified range." << std::endl;
}

return 0;

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register
...