Let $x$ be an integer which can take a value of $0$ or $1$. The statement
if $(x = = 0) x = 1;$ else $x = 0;$
is equivalent to which one of the following ?
- $x = 1 + x;$
- $x = 1 - x;$
- $x = x - 1;$
- $x = 1\% x;$
My attempt :
It should be only option $(2)$ is true. but,
Can you explain little bit please, what is the value of $1\%0$ ?
AFAIK: It should be undefined, since it applied division $1/0$ which is undefined.
"$1\%0$" would be equivalent to $1-\Big\lfloor\frac10\Big\rfloor\times0$.
Modulo by $0$ is as meaningless as Division by $0$.