Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
30 views

Algorithm

Control structures in algorithms use selection statements like IF-THEN-ELSE and CASE to choose between blocks of code based on conditions, as well as looping statements like REPEAT-UNTIL, WHILE, and FOR to repeatedly execute blocks of code. Selection statements include IF-THEN-ELSE and CASE, while looping statements contain constructs for repeating code such as REPEAT-UNTIL, WHILE, and FOR loops. It is important to remember to properly end selection and looping statements in algorithms.

Uploaded by

lalkesav
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views

Algorithm

Control structures in algorithms use selection statements like IF-THEN-ELSE and CASE to choose between blocks of code based on conditions, as well as looping statements like REPEAT-UNTIL, WHILE, and FOR to repeatedly execute blocks of code. Selection statements include IF-THEN-ELSE and CASE, while looping statements contain constructs for repeating code such as REPEAT-UNTIL, WHILE, and FOR loops. It is important to remember to properly end selection and looping statements in algorithms.

Uploaded by

lalkesav
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

ALGORITHM

Control Structures: Selection & Looping Statements

Selection Statements

CASE (Variable) OF Selection


1: Statement 1 Statements
2: Statement 2
3
.
IF (Condition) THEN
.
Statement 1
OTHERWISE
ELSE
Statement
Statement 2
END CASE
ENDIF

Looping Statements
Loop executes
while the condition
REPEAT is false.

Statements

UNTIL (Condition)

Exit Control Loops

Do

Statements Loop executes


WHILE (Condition) while the condition
is true.
Loops
Loop executes
WHILE (Condition) while the condition
is true.
Statements

END WHILE

Entry Control Loops

FOR (Range)

Statements Loop executes


END FOR while the number is
in the range.

Important

 No marks for START and STOP


 Remember to end the loops and the selection statements.

You might also like