So I am simplifying fractions for my fractions class and I am having trouble with the euclidian code for the gcd, it also doesn't print to the console window it just runs and nothing happens:
public class GCD {
public static void main(String[]args)
{
int n = 5 ;
int d = 6 ;
int larger, small ;
if(n>d)
{
larger = n ;
small = d ;
}
else
{ larger = d ;
small = n ;
}
while(small !=0)
{
int remainder = larger % small ;
larger = small ;
small = larger ;
}
System.out.print("The GCD of " + n + "and" + d + "is larger") ;
}
}