I have written a simple Java program as shown here:
public class Test { public static void main(String[] args) { int i1 =2; int i2=5;
Since i1=2 and i2=5 are integer type and when you divide (2/5) them, It gives integer value (0) because fractional part(.4) get discarded. So put (double)i1/i2 on the equation.