The if Statement

The syntax:

if ( test condition )

     { command(s) }

else

     { command(s) }

Example 1

Example 2


The for Loop

for ( init ; test ; increment ) 

{ commands }


Other Loops

while ( condition )

{ commands }

do

{ commands }

while ( condition )