C PROGRAMMING

Control Statements

Article by:
Date Published:
Last Modified:

Overview

Control statements in the C programming language are constructs which allow you to conditionally execute pieces of code, based on whether a condition is true or false.

The most basic C control statement is the if statement. The C programming language has many different control statements, including if-else, if-elseif-else, while, for, and switch.

Off-by-1 Errors

A common mistake is to get the bounds of a looping control statement wrong by 1 (i.e. the loop executes one too less, or one too many times).


Authors

Geoffrey Hunter

Dude making stuff.

Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License .

Tags

    comments powered by Disqus