Computer Science SLO Based Key Point Notes

👉👉👉 Computer Science 12th Class Notes (Main Page)

************************************

Unit 4: Control Structures


4.2.5. The break and Continue Statement 

The break Statement:

The break statement has two usages:
  1. It is used to terminate a case in the switch statement and program execution continues from the next statement following switch statement.
  2. The break statement is also used to terminate a loop when it is encountered inside a loop and program execution continues from the next statement following the loop.

The continue Statement:

The continue statement is used inside a loop, which transfers control to the beginning of the loop, skipping the remaining statements.

Example # 1:

#include <iostream.h>
#include <conio.h>
void main()
{
        clrscr();
        for (int k=1; k<=10; k++)
        {
                cout<<k<<“\n”;
                if(k == 4)
                            break;
        }
        getch();
}


Example # 2:

#include <iostream.h>
#include <conio.h>
void main()
{
        clrscr();
        for(int n=1;n<=15;n++)
        {
                if((n>5) && (n<10))
                            c
ontinue;
                cout<<n<<endl;
        }
}

************************************
👉👉👉 Computer Science 12th Class Notes (Main Page)

************************************



(National Book Foundation - As Federal Textbook Board, Islamabad 
Based on National Curriculum Pakistan 2026-2027 and Onward prescribed by Federal Board of Intermediate and Secondary Education, Islamabad, and All Pakistan Boards) 

{Contact WhatsApp # +923339719149 for Class-XII Computer Science Complete SLO-Based Key Points notes in pdf format as well as in PowerPoint Presentation for preparing/delivering the Lectures}

Note:  Write me in the comments box below for any query and also Share this information with your class-fellows and friends.