Next:
for
Up:
Control Structures
Previous:
Control Structures
if
if ( a > b ) { // other operators: >= < <= != == return a; } else { return b; }
don't forget the
()
around the if-condition
most common error: using
=
instead of
==
.
Tip:
if possible, use
3 == a
instead of
a == 3
, that way the compiler will find the error.
Andreas Koeller
2000-06-04