🚀 Code smarter. Crack exams faster. Free AI-powered learning on Leyaa.ai →
control statements
Control statements are used to decide the program execution order based on some conditions.
It is also called decision making statements.
Example
Let’s write a program for dividing two integers.
But, if we divide a number by 0, program execution will stop as its undefined behavior.
Here, we must decide and restrict the execution of dividing code, if the divisor is zero.
Dividing a number by zero is undefined.
So, the execution order will be,
If divisor is zero
     Don’t execute division statement.
Else
     Execute it.
Let’s discuss about it one by one with examples.
🚀 Learn 90+ coding courses & crack 200+ competitive exams
AI-powered learning intelligence that adapts to you — Python, Java, SQL, Aptitude, Reasoning & more. Completely free.
Start Learning on Leyaa.ai →