Recursive program to calculate Greatest Common Divisor Of 2 programs.

Recursive program to calculate Greatest Common Divisor Of 2 programs.
class GCD{
public void accept(int n1,int n2){
int big=(n1>n2)?n1:n2;
int small=(n1<n2)?n1:n2;
int gcd=Grcodi(big,small);
System.out.print("The greatest common divisor"+"\t\t"+gcd);
}
int Grcodi(int p,int q){
if(q==0)
return p;
return Grcodi(q,p%q);
}//accept
}//End of class
OUTPUT---
When Input is 3 & 2
The greatest common divisor 1

Comments