Professional Documents
Culture Documents
GCD Codes in Java Programming
GCD Codes in Java Programming
*;
public class{
static Scanner input = new Scanner(System.in);
public static void main(String[] args){
If (a < b){
Int c = a;
a = b;
b = c; }
Int x, m;
do{
x = a/b;
m = a%b;
System.out.println(a + = + x + (b) + + + m);
a = b;
b = m;
}
while( m != 0);
System.out.println(GCD is: a);
}
}