A subroutine is a self-contained set of statements taht can be used from anywhere in a program.The sub routine perform its specific task,and then returns control to the part of the program that calls the subroutine.Some times it is more convininent to structure a sequence of statements as a subroutine than as a function.