12th Class (HSSC-II) Computer SLO Based Key Point Notes

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

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

Unit 4: Control Structures

➰➰ LOOP ➰➰

4.2. Loop

The mechanism through which a statement or set of statements can be executed repeatedly is called a loop OR
There are two essential elements of a loop:
1. A loop body that consists of the statement or a set of statements that is to be executed repeatedly.
2. A loop condition is used to determine when to stop the loop.

Control variable:

  • A variable, which is used in loop conditions to control the repetition of a loop is known as a loop control variable.
  • The control variable must be initialized before the body of the loop.
  • Its value must be changed inside the body of the loop so that the repetition of the loop can be controlled.


Types of Loop

C++ provides three types of different loops which are:
1. For Loop
2. While loop
3. Do-while loop


************************************
👉👉👉 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  & XI - 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.