CONTROL Statement : GOTO

 

LEC 9:Goto Statement

Source code:

/*

GOTO statement :-

    The goto statement is a jump statement which is sometimes also referred to as unconditional jump statement.

    The goto statement can be used to jump from anywhere to anywhere within a function.


*/

#include<iostream>

using namespace std;

int main()

{

    int i;

    aa:

    cout<<"hello everyone\n";

    cout<<"if you want to continue, press 1\n";

    cin>>i;

    if(i==1)

    {

        goto aa;

    }

    return 0;

}


Comments

Popular posts from this blog

RunwayWithCode

web development Lectures

C++ Lectures