Programming Constructs

There are THREE basic programming constructs. They are:

  • SEQUENCE
  • SELECTION
  • ITERATION
SEQUENCE

Sequence logic is used for performing instructions one after another in sequence.

  • Sequence is the most basic of the constructs
  • It is simply performing one step after another
  • Each step is followed in a specific sequence, hence the name
  • Sequence can be thought of as “do this, then do this, then do this”

SELECTION

Selection logic, also known as decision logic, is used for making decisions. Selection logic is depicted as either an IF…THEN…ELSE or IF…..THEN structure.

  • Selection is the decision-making construct.
  • It is used to make yes/no or true/false decisions logically.
  • Selection can be thought of as “if something is true, take this action, otherwise take that action”.

ITERATION

Iteration logic is also known as Loop. Iteration logic is used when one or more instructions may be executed several times depending on some condition.

  • Iteration comes from the word “reiterate”, which means to repeat
  • Iteration is a looping construct
  • Iteration is a combination of decision and sequence and can repeat steps
  • Iteration can be thought of as “while something is true, do this, otherwise stop”

Gopal Krishna

Hey Engineers, welcome to the award-winning blog,Engineers Tutor. I'm Gopal Krishna. a professional engineer & blogger from Andhra Pradesh, India. Notes and Video Materials for Engineering in Electronics, Communications and Computer Science subjects are added. "A blog to support Electronics, Electrical communication and computer students".

Leave a Reply

Your email address will not be published. Required fields are marked *

Translate »