Passing Values to Functions
Now a function can read a variable from the main program inside a function, but it cannot write to that variable. This can cause some confusion, and rightly so. So lets not do that. Instead, we can change how a function behaves by passing values to a function. These values are called parameters. An argument…