Notation (pseudo code, flow chart)
Notation (pseudo code, flow chart)
Pseudo Code
Flow Chart
Programming language
Pseudo Code
Pseudo code
BEGIN
READ the values of A and B
COMPUTE C by multiplying A with B
PRINT the result C
END
Selection Logic
It is used for making decisions and for selecting the proper path
out of two or more alternative paths in program logic.
It is also known as decision logic.
Selection logic is depicted as either an IF..THEN or an IF…
THEN..ELSE Structure.
Syntax for if else
IF (condition)THEN
statement1
...
ELSE
statement2
...
ENDIF
Example : Greatest of two numbers
BEGIN
READ the values of A and B
IF A is greater than B THEN
DISPLAY “A is greater”
ELSE
DISPLAY “B is greater”
END IF
END
Iteration Logic
BEGIN
GET the value of N
INITIALIZE I to 1
FOR I less than or equal to N DO
PRINT the value of I
INCREMENT I by 1
ENDFOR
END
Advantages
Binary selection
Flowchart to find biggest among three numbers
Multi-way selection
Iteration Logic