Break statement is used to terminate the loop and resume the program execution from the next statement following the loop.
If we want to use break statement inside loop, we have to use it along with if statement.
It is also used to terminate the switch case execution.
Get integer input from user and print it continuously until the user gives a negative number.
If user gives a negative number, the loop will terminate and the statement next to loop will execute which is return 0.