:Selection: `if' with compound statement
The statement that is to be executed if
the test is true can either be a single statement such as soundAlarm() above, or it can be a compound
statement (one or more statements blocked with the open and close braces "{"
"}"). For example, we might wish to perform more than one action if the
temperature is too high:
if (temperature > 78)
{
soundAlarm();
displayFlashingLight( red );
triggerAlarmAtFireStation();
}
Back to top
RITSEC - Global Campus
Copyright ?1999 RITSEC- Middlesex University. All rights
reserved.
webmaster@globalcampus.com.eg
|