When the return statement is executed in a function, then it terminates the execution of the function and returns control to its caller function.
Read this post on aticleworld.com