Chapter 4 Quiz Starting Out With C++ 009

How do you write an "if" statement in C++?  Which sample below is the best

a.
  if (x >y) then
{
   tmp++;
}

b.
if ( x >y )
 tmp++;

c.
 if x>y
  tmp++
else
 tmp--;

d.
None of the above.  They won't compile

1 comment: