Answer to Question #158912 in C++ for Banele

Question #158912

in one way selection, if a semicolon is placed after the expression in a if statement, the expression in the if statement is it always true


1
Expert's answer
2021-01-27T06:00:36-0500

this statement is false

because:

  • Syntax of one-way (if) selection:
if (expression)
  statement1;
  statement2;
  • if is reserved word
  • expression must evaluate to true (nonzero) or false (0)
  • statement1 executed if value of expression true
  • statement1 bypassed if value false; program execution moves to statement2
  • statement2 is executed regardless

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