If
The if
statement is a programming conditional statement that, if proved true, performs a function or displays information.
tldr;β
- Do simple stuff π¦ with the
if
. - No
else
block to confuse the infants π§ - Simple arithmetic conditions works. π
Do more with the if
π±βπβ
Use the if
to do conditional stuff like checking if the memory is 79 or the pointer is 320. Give it a try!!
danger
But no negative integers thouβ¦ π
The if
cannot handle negative numbers be it the pointer or the memory or the number itself.
It can check a bunch of conditions like:
if
the memory is equal to the pointerif
the memory is greater than the pointer and many more...
- With Pointer and Memory
- With a Number
if pointer == memory print char memory
if memory == 79 print char 79
It also supports logical checking π§ with &&
, ||
and !
.
- Logical AND &&
- Logical OR ||
- Logical NOT !
if pointer && memory print char memory
if memory || pointer print new
if memory != 79 print char pointer