Gcd program in java


public class gcd1
{
public static int gcd(int x,int y)
{
if(y==0)
{
return x;
}
else
{
return gcd(y,x%y);
}
}
public static void main (String args [])
{
System.out.println(gcd(10,5));
}
}

Comments

Popular posts from this blog

GL_QUAD_STRIP Example In OpenGl

GL_TRIANGLE_FAN Example In OpenGl