Skip to main content

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 pointer
  • if the memory is greater than the pointer and many more...
if pointer == memory print char memory

It also supports logical checking 🧠 with &&, || and !.

if pointer && memory print char memory