Firstly, our requirement is for $x=1$ it makes '$0$' and for $x= 0$ it makes '$1$'
Let's consider options one by one:
- $x= 1+x$
- For $x = 1$, it gives $2$ So, False
- $x= 1- x$
- Here, B is correct, as
- For $x= 0$, it gives $1$.
- For $x= 1$, it gives $0$.
- $x = x - 1$
- For $x=0$ , it gives $-1$. So, False
- $x = 1 \% x$
- For $x= 0$ , it gives $1 \% 0$ . I think it is undefined
- Even if we consider $x = x\%1 $
- for $x= 0$ ,it gives $0\%1 = 0$ But we require $1$.
So, Option (B) is correct.