Question #99413

Write an expression that will cause the following code to print "greater than 20" if the value of userAge is greater than 20.

Expert's answer

#include <iostream>

int main() {
    int userAge;
    std::cin >> userAge;
    if (userAge > 20) {
        std::cout << "greater than 20\n";
    }
    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS