Flip the int Boolean

Published by Werdna in

A boolean is a data type that has only two values true or false. These values often correspond to 1 (true) or 0 (false). When a 1 or a 0 is used, it's called an int boolean.

Write a function that takes an int boolean and outputs its opposite (i.e. 1 becomes 0 and 0 becomes 1).

Examples

flipIntBool(1) ➞ 0

flipIntBool(0) ➞ 1

Notes

N/A

Watch a quick demo on how Edabit works.