how to get division and reminder in one operation?# Programming - 葵花宝典
c*u
1 楼
image we have two integers N1, N2.
If we want to get the division, we do : division = (int) N1/N2;
if we want to get the reminder, we do: reminder = N1 % N2;
The interview question is how to get both division and reminder in just one
operation, instead of two?
If we want to get the division, we do : division = (int) N1/N2;
if we want to get the reminder, we do: reminder = N1 % N2;
The interview question is how to get both division and reminder in just one
operation, instead of two?