I have to swap two variables with a number value without using a third variable. What is the simple solution?
You can achieve it with XOR
int A = ...; int B = ...; A = A ^ B; B = A ^ B; A = A ^ B;