To make a routine more flexible, you can pass parameters to the routine to give it extra information that it can use to perform its task. For example, suppose that you write a routine to print a student’s course schedule. You could make the routine receive a parameter that gives the ID of the student whose schedule it should print.
Giving the routine a parameter makes it much more flexible. In this example, it allows one routine to print the schedule for any number of students instead of just one.
Exactly how you define a routine’s parameters depends on the language you are using, but the idea is the same in every language. The routine’s declaration includes declarations for any parameters that it will take.
For example, the following ...