[SOLVED] Trouble with this loop!

i want to write a program to sum of this serie 1/3 + 3/5 + 5/7 + ...+ 95/97.

in my program what i did is that make a loop for the numerator and denominator, both will skip even number. then i put the num and den together and add them to get the sum, but some how it gives me 0.0.

any suggestions for what i need to change?

Code:

`public class TT{`

public static void main (String[]args){

System.out.println("what is the sum if this serie: 1/3 + 3/5 + 5/7 + ...+ 95/97 + 97/99?");

int a = 1;

int b = 3;

double total = 0;

int num=0;

int den=0;

for (int top = a; top<=97; top++){

if ( top%2==0)

continue;

num = top;

}

for (int bottom = b; bottom<= 99; bottom++){

if (bottom%2 == 0)

continue;

den = bottom;

}

total = total + (num / den);

System.out.println("sum of the series is: "+ total);

}

}