CONTROL STATEMENT | BREAK

 

LEC:8,

CONTROL STATEMENT | BREAK

Source code:

/*

        Break statment:-

        The break statement terminates the execution of the nearest enclosing

        do, for, switch, or while statement in which it appears.

        Control passes to the statement that follows the terminated statement.

*/

#include<iostream>

using namespace std;

int main()

{

    for(int i=1;i<10;i++)

    {

        if(i%2==0)

        {

            cout<<"value of i :"<<i<<endl;

             //break;


        }


    }

    return 0;

}

Comments

Popular posts from this blog

RunwayWithCode

web development Lectures

C++ Lectures