When the computer executes a variable declaration, it sets aside memory for the variable and associates the variable's name with that memory. Good programming style is to declare only one variable in a declaration statement, unless the variables are closely related in some way. Variables declared inside a subroutine are called local variables for that subroutine. They exist only inside the subroutine, while it is running, and are completely inaccessible from outside. Variable declarations can occur anywhere inside the subroutine, as long as each variable is declared before it is used in any expression.
Some people like to declare all the variables at the beginning of the subroutine.
Others like to wait to declare a variable until it is needed. The interest and the value of the investment after one year are printed to standard output. The value of the investment. The annual interest rate. This program uses several subroutine call statements to display information to the user of the program.