Hello,

I'm trying to print out the sum of these fractions, 1/30, 2/29, 3/28, 4/27, ... 30/1

But my code only printed out the quotien of each fraction, not the sum of all fractions.

Can you please tell me what went wrong?

Thank you in advance.

 
       int i, j; 
       double sum, quotient;
 
       for (i = 1, j = 30; i <= 30; i++, j--) {
 
           quotient = (i / j); 
           sum += quotient;
 
           System.out.println(sum);
 
       }