If Statement
Example:
In the above block of code:
Their is a
if
keyword followed by a set of parentheses()
which is followed by a block of code inside a set of curly braces{}
.Inside the parentheses
()
, a condition is provided that evaluates totrue
andfalse
.If the condition evaluates to
true
, the code block inside the curlt braces will run or execute.If the condition evaluates to
false
, the block wont execute.
Example:
Last updated