Control statmenrs : Control statements are the ones that specify the program flow or the order in which the steps or instructions need to be executed. They perform the task of decision making, depending on the conditions specified in the program. There are four types of control statements in the C programming language:
Decision making
Selection
Iteration
Jump
Decision-making statements decide the flow of the program based on logical conditions like OR, AND, and NOT. The set of statements that are nested below the decision-making statements are executed based on the logical criteria met. The if and if-else (and nested if-else) are sets of decision-making statements in C.
Selection statements are based on case switch keywords. If the condition specified in the case keyword is met, then the statements below the case will be executed, and else switch statements will be executed. Iterations statements (or loops) are statements that repeat the set of instructions present inside the blocks until the condition is met. The looping statements in C programming language are while, do-while, while do, and for loop.
A counter is usually incremented or decremented inside the looping or iterative statements to make sure the loop exits when the condition is met. Jump statements are GOTO statements that can abruptly change the course of the program to execute different sets of statements mentioned in the GOTO statement. Generally, GOTO statements are not recommended in the program, as it would be difficult to predict the flow of the program in run time.