A statement can be an assignment, a function call, a loop, a conditional statement or even a statement that does nothing (an empty statement). Statements usually end with a semicolon. In addition, statements can be grouped into a statement-group by encapsulating a group of statements with curly braces. A statement-group is a statement by itself as well. The control statement can be an assignment, a function call, a loop, a conditional statement or even a statement that does nothing or an empty statement.
These conditions, and the actions associated with them, are expressed by means of programming construct called a conditional statement.
The if Statement
In if Statements Output will appear when the only Condition must be true.
The if-else Statement
if-else statements allow you to display output in both the condition(if the condition is true display some message otherwise display other messages).
The if-elseif-else Statement
The if-else-if-else statement lets you chain together multiple if-else statements, thus allowing the programmer to define actions for more than just two possible outcomes.
The switch Statement
The switch statement is similar to a series of if statements on the same expression.
© 2024 Easy To Learning. All Rights Reserved | Design by Easy To Learning