C Control Statements

Previous
Next

Program Control Types: There are three types of program controls,

Sequence control structure:

  • Sequence instruction means executing one instruction after another, in the order in which they occur in the source file.
  • This is usually built into the language as a default action, as it is with C.
  • If an instruction is not a control statement, then the next instruction to be executed will simply be the next one in sequence.

Selection structures:

  • Selection means executing different sections of code depending on a specific condition or the value of a variable.
  • This allows a program to take different courses of action depending on different conditions.
  • Those are if, if-else, nested if, if–else if and switch…case…break:

Repetition:

  • Repetition/Looping means executing the same section of code more than once.
  • A section of code may either be executed a fixed number of times, or while some condition is true. 
  • Those are for, while and do…while
Previous
Next

Add Comment

Courses Enquiry Form