BCA / B.Tech 8 min read

Control Statements in C

Control Statements in the C Language:


In the C language, control statements are used to control the flow of a program. These statements determine which part of the program will be executed, when, and how many times. Using control statements, we can make decisions, loop, and customize execution, making the program more powerful and flexible.

Types of Control Statements:
1. Decision-Making Statements: Used when we need to run a specific part of the program based on certain conditions. These include `if`, `if-else`, `if-else-if ladder`, and `switch` statements.
2. Looping Statements: Used to run a block of code repeatedly as long as a condition is true. The three main loops in C are `for`, `while`, and `do-while`.
3. Jump Statements: Used to transfer the program's control from one location to another. The three main jump statements in C are `break`, `continue`, and `goto`.

The document provides detailed syntax and examples for each of these control statements.