In a program, of course, this subroutine must be referred to as System.exit . Calling this subroutine will terminate the program. You could use it if you had some reason to terminate the program before the end of the main routine. The parameter tells the computer why the program is being terminated. A parameter value of 0 indicates that the program is ending normally.
Every subroutine performs some specific task.
For some subroutines, that task is to compute or retrieve some data value. Subroutines of this type are called functions . We say that a function returns a value. The returned value must then be used somehow in the program. You are familiar with the mathematical function that computes the square root of a number.