CyberSlug Rules!

Beginner Programming CMPS060

Prof. Paulo Franca

Home

Syllabus

Login

Objects

Download

Staff only

C++ Conditions

if ( <condition> ) ...
while ( <condition>) ...
for( <exp1>;<condition>;<exp2>) ...

A condition:

  • is an expression where a relational operator is used to compare values;
  • may determine if a piece of program is executed or not.
  • has a result =0 if the condition is false; 1 otherwise.

Complex conditions (compound)