0% found this document useful (0 votes)
23 views8 pages

Control Structures

ppt

Uploaded by

Seggs ss
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views8 pages

Control Structures

ppt

Uploaded by

Seggs ss
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 8

CONTROL STRUCTURES

CONTROL STRUCTURE

• Three methods of processing a program


• In sequence
• Branching - altering the flow of program
execution by making a selection or choice
• Looping - altering the flow of program
execution by repetition of statement(s)
FLOW OF EXECUTION
RELATIONAL OPERATORS

• Greater than (>): Checks if the value on the left is greater than the value on
the right.
• Greater than or equal to (>=): Checks if the value on the left is greater than or
equal to the value on the right.
• Less than (<): Checks if the value on the left is less than the value on the
right.
• Less than or equal to (<=): Checks if the value on the left is less than or equal
to the value on the right.
• Equal to (==): Checks if the values on both sides are equal.
• Not equal to (!=): Checks if the values on both sides are not equal.
LOGICAL (BOOLEAN) OPERATORS

• Logical AND (&&): It returns true if both the operands are true.
• Logical OR (||): It returns true if at least one of the operands is true.
• Logical NOT (!): It is used to reverse the logical state of its operand. If a
condition is true, then the logical NOT operator will make it false.
SELECTION

• One – Way Selection


• Two – Way Selection
• Compound
statements
• Multiple selection
• Conditional operator
• Switch Structure
SWITCH STRUCTURE

• switch, case, break, and default are reserved words


• In a switch structure, the expression is evaluated first
• The value of the expression is then used to perform the actions specified in
the statements that follow the reserved word case
• The expression is usually an identifier
• The value of the identifier or the expression can be only of type int, byte,
short, or char
• A particular case value must appear only once

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy