Go To Statement In C++


We can use the goto statement to execute a group of statement repetition until condition not match. It’s one types of jump statement.


Simple example of goto statement in c++

#include<iostream>

using namespace std;

int main(){

int c=0;

clrscr();

start :

c++;

if(c<=10)

{

cout<<“%d \t”,c);

go to start;

}

return0

}


Output
1 2 3 4 5 6 7 8 9 10