Waiting for answer This question has not been answered yet. You can hire a professional tutor to get the answer.

QUESTION

Can anyone help me with this please..? Which of the following IF statements displays Hello ?

Can anyone help me with this please..?

Which of the following IF statements displays Hello?

A) int myVal = 4;

if (myVal < 10)

  cout << "Hello";

else

  cout << "Bye";

B) int myVal = 4;

if (myVal > 10)

  cout << "Hello";

else

  cout << "Bye";

C) int myVal = 10;

if (myVal < 10)

  cout << "Hello";

else

  cout << "Bye";

D) int myVal = 41;

if (myVal < 10)

  cout << "Hello";

else

  cout << "Bye";

Flag this Question

Question 2

Assuming num equals 4, which of the following IF statements is correct if the desired output is

statement1

statement2

A) if (num > 3)

  cout << "statement 1" << endl;

  cout << "statement 2" << endl;

else

  cout << "statement 3" << endl;

  cout << "statement 4" << endl;

B) if (num > 3) {

  cout << "statement 1" << endl;

  cout << "statement 2" << endl;

}

else {

  cout << "statement 3" << endl;

  cout << "statement 4" << endl;

}

C) if (num > 3)

  cout << "statement 1" << endl;

  cout << "statement 2" << endl;

else {

  cout << "statement 3" << endl;

  cout << "statement 4" << endl;

}

D) if (num > 3) {

  cout << "statement 1";

  cout << "statement 2";

}

else {

  cout << "statement 3" << endl;

  cout << "statement 4" << endl;

}

Flag this Question

Question 3

Assuming variable num equals 4, which of the following IF statements is correct if the desired output is

statement1 statement2

A) if (num > 3)

  cout << "statement 1_";

  cout << "statement 2" << endl;

else

  cout << "statement 3" << endl;

  cout << "statement 4" << endl;

B) if (num > 3) {

  cout << "statement 1" << endl;

  cout << "statement 2" << endl;

}

else {

  cout << "statement 3" << endl;

  cout << "statement 4" << endl;

}

C) if (num > 3) {

  cout << "statement 1 ";

  cout << "statement 2" << endl;

}

else {

  cout << "statement 3" << endl;

  cout << "statement 4" << endl;

}

D) if (num > 3) {

  cout << "statement 1" << endl;

  cout << "statement 2";

}

else {

  cout << "statement 3" << endl;

  cout << "statement 4" << endl;

}

Flag this Question

Question 4

What is displayed on the console based on the following code fragment?

int num = 2;

if (num == 2)

  cout << "On";

else

  cout << "Off";

A) Off

B) On

C) all of the above

D) none of the above

Flag this Question

Question 510 pts

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question