A java code to find the gcd of two numbers | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
0

A java code to find the gcd of two numbers

to find the greatest common divisor of the numbers. and I want it to implement with Java.

18th Jan 2017, 6:02 PM
WONDE-TOM
WONDE-TOM - avatar
2 Respuestas
+ 1
your problem is more math is not a programming problem
18th Jan 2017, 6:30 PM
alireza shokri
alireza shokri - avatar
+ 1
int gct(int a, int b){ while(b != 0){ int r = a%b; a = b; b = r; } return a; }
18th Jan 2017, 6:36 PM
Robobrine
Robobrine - avatar