Answer to Question #218638 in C++ for vic2019

Question #218638

Write code that puts "less than -9\n" to output if the value of userNum is less than -9.

Ex: If userNum is -15, then output is:

less than -9
userNum: -15
1
Expert's answer
2021-07-19T00:35:28-0400
#include <iostream>
using namespace std;
int main(){
    int userNum;
    cout<<"Enter userNum: ";
    cin>>userNum;
    if(userNum < -9){
        cout<<"less than -9\n";
        cout<<"UserNum: "<<userNum;
    }
    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