The goto statement is known as jump statement in C++ language . The goto statement is used for transferring the control of a program to a given label.
This is used to transfer program's control from one statement to another statement.
goto label or statement;
#include void main() { int goals; cout<<"Enter No Of Goals:"; cin>>goals; if(goals<=5) goto error; else { cout<<"You Are Welcome"; exit(); } error: cout<<"Sorry Try Again"; }
output:-
Enter No Of Goals:
Sorry Try Again
Enter No Of Goals:
You Are Welcome