Question #7941

write a program using the if else statement

Expert's answer

//include this file for cout
#include <iostream.h>

int main()
{
// define two integers
int x = 3;
int y = 4;

//print out a
message telling which is bigger
if (x > y) {
cout << "x is bigger
than y" << endl;
}
else {
cout << "x is smaller than y"
<< 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!

LATEST TUTORIALS
APPROVED BY CLIENTS