Posts

Showing posts from October 16, 2022

Control Statements in C Programming | C Programming

Image
Control Statement Control statements enable us to specify the flow of program control i.e., the order in which the instructions in a program must be executed. They make it possible to make decisions, perform tasks repeatedly, or jump from one section of code to another. The different forms of if statements with their syntax and semantic diagram are: - If statements: -  The if statement evaluates the test expression inside the parenthesis. If the test expression is evaluated to true (non-zero), statements inside the body it is executed. If the test expression is evaluated to false (0), statements inside the body of if are skipped from execution. The Syntax and Semantics diagram are: if (test expression) {     (statements) } If else statement:  The if-else statement executes some code if the test expression is true (nonzero) and some other code if the expression is false (0). If the tested expression is true, codes inside the body of the if statement is executed and, codes inside the