I'm facing this problem in my code where I trying to read a user's input for a division operation displayed on an LCD. I'm interested in using division operations without reminders since it is easier for users to input single digit (or two) instead of a fraction. To do so, I check the reminder between two randomly generated first. If it is zero, I display the equation. If it is not a zero (division operation has a reminder), I pick another two random numbers.

I know that the method that I am using is logically correct, I'm not sure why my code keeps displaying the division operations with reminders! I'm speculating it is probably because I'm using long as a datatype for the randomly generated numbers and the result as well.

Can anyone help me understand this behavior or if anyone has faced this problem before? Here is a snippet of my code where I generate the division.

```
long num1, num2, result;
randomSeed(analogRead(0)); //Generate different numbers
num1 = random(1, 11); // between 1 and 10
num2 = random(1, 11); // between 1 and 10
while (num1%num2 !=0){
num1 = random(1, 11); // between 1 and 10
num2 = random(1, 11); // between 1 and 10
}
result = num1/num2;
```