Syntax of Flow chart
We can can use the following C constructs to control program execution.
When we can count our way through a sequence or series:
for( initial value; keep on until ; incremental change )
{ do this; and this; and this; }
When we are waiting for some condition to change:
while( this is true )
{ do this; and this; and this; }
or if we want to do something at least once then test:
do { do this; and this; and this; }
while( this is true )
When we have a single option to test:
if( this is true )
{ do this; and this; and this; }
else
{ do this; and this; and this; }
When we have more options to test:
if( this is true )
{ do this; and this; and this; }
else if
{ do this; and this; and this; }
else if
{ do this; and this; and this; }
When we have more options to test based on an integer or single character value:
switch( on an integer or character value )
{
case 0: do this; and this; and this; break;
case 0: do this; and this; and this; break;
default:do this; and this; and this; break;
}