Control Structures in C: Getting Started with Control Structures

placeholder

A control structure in C is any code construct that changes the flow of control such as the order of execution in a program. The three main types of control structures in C are decision-making control structures looping control structures and unconditional control structures. Decision-making control structures include if-else blocks and switch statements. You will start this course by working with the if statement control structure. This checks whether a condition is satisfied or not and returns an output based on that. You will then use the if-else-if ladder to create multiple conditions that will be checked in order. The code block associated with the first condition that is satisfied will be executed and subsequent conditions will not even be checked. Finally you will learn about the ternary operator which makes use of the ? and : symbols to create an if-else block and store the result in a variable. Upon completion of this course youll be able to work with control structures to change the flow of execution of a C program use if and else conditions and employ the ternary operator in assignments and expressions