I have two variables M & N and with certain condition in my loop I want to switch the value of N between itself and M. So the following code came in my mind
MxN = M * N;
N = MxN/N;
But values of M and N may be 2 000 000 000. Therefore Im in doubt. Is that fine variant to switch between such a huge values or may be its better(faster) to
counter = 2;
N = counter % 2 == 0 ? M : N;
counter++;
edit
Sorry I didn't mention that I dont want to affect the value of M
Thanks everyone)