The If statement as we all know tests a condition and then according to the result, like it is
false, a particular
if statement tests a specified condition and then if the condition evaluates to true then the block of code defined in the
if statement gets executed otherwise the block is skipped.
In the previous statement there was no block of code defined for the false evaluation of the condition, which is defined here in
else statement. The
if....else statement also tests a condition but here the
else statement is present. The
if block's code gets executed if the given condition is true otherwise if the condition is false then the
else block's code gets executed.
if...elseif statement tests multiple conditions and executes different blocks of code for
more than two conditions. First, a condition specified in
if statement is tested, then if that evaluates to false, then only the
elseif's statement is tested. And if
else statement is defined and both the previous condition evaluates to false then only the
else statement gets executed.
Note: If the updated content is not visible to you please refresh the cookies by pressing CTRL + Shift + R.