Chapter 4 Quiz Starting Out With C++ 012

Putting a semicolon after the if (expression) is a common mistake and will lead to a compiler error

if (x>y);
  temp++;

a. false
b. today's compilers are smart enough and will remove the semi-colon
c. you'll get a warning message but the compiler knows what you mean
d. true

1 comment: