Yesterday I had to face an interview, in that interview they asked me a question like: Tell me the difference between % and / ?
I know the result what they gave, but I wasn't able to explain it theoretically. Will you please give me any body who can explain it theoretically, I have also done a program on this:
class FindDifference
{
public static void main(String[] args)
{
int num1=12;
int num2=3;
int modulus=num1%num2;
int divide=num1/num2;
System.out.println("modulus :"+modulus);
System.out.println("division :"+divide);
}
}
and my result is:
modulus :0
division :4
But how can I give the theoretical explanation between them? Will you please help me?