Can You Use Arithmetic Operators to Flip Between 0 and 1
x = 1 - x
Will switch between 0 and 1.
Edit: I misread the question, thought the OP could use any
operator
A Few more...(ignore these)
x ^= 1 // bitwise operator
x = !x // logical operator
x = (x <= 0) // kinda the same as x != 1
Without using an operator?
int arr[] = {1,0}
x = arr[x]