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


Expert's answer

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!

LATEST TUTORIALS
APPROVED BY CLIENTS