Decisions, decisions...
Our programs so far have broken down into a list of
steps, one after the other. Sometimes, however, we need
to make decisions and choose between two or more options.
Pascal uses the keywords IF, THEN and ELSE
when making choices.
Example 12
This is a simple program that reads in a person's age
and prints out a message.
- type in the program below
- save it as voting.pas
|