Answer to Question #99417 in C++ for Caleb

Question #99417
Write an expression that will cause "Foot or more" to print if the value of numInches is greater than or equal to 12.

#include <iostream>
using namespace std;

int main() {
int userNum;

cin >> userNum; // Program will be tested with values: 1, 2, 3, 4.

if (userNum = 2) {
cout << "Num is less or equal to two" << endl;
}
else {
cout << "Num is greater than two" << endl;
}

return 0;
}
1
Expert's answer
2019-12-05T10:33:09-0500

#include <iostream>

using namespace std;

int main() {

int userNum;

cin >> userNum; // Program will be tested with values: 1, 2, 3, 4.

if (userNum <= 2) {

cout << "Num is less or equal to two" << endl;

}

else {

cout << "Num is greater than two" << endl;

}

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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS