|
|
|
||||||
|
A sample execution of the program results the following output.
Now think what happens if the
condition in the if statement is not true i.e. Amer’s age is not greater than Amara’s.
In this case, if the user enters Amer’s age less
than Amara’s, then our program does nothing. So to
check this condition, another if statement after the first if statement is
required. Then our program will be as: .
Now our program decides
properly about the ages entered by the user. After getting ages from the
user, the if statements are tested and if statement
will be executed if the condition evaluates to true.
|
|||||||
|
|
Previous |
TOC |
Next |
||||