Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
| Download
Views: 3731
1
public class Euclid{
2
3
public static int gcd(int p, int q){
4
if (q == 0) return p;
5
return gcd(q, p%q);
6
}
7
8
public static void main(String[] args){
9
int p=24;
10
int q=12;
11
int d=gcd(p,q);
12
System.out.println(d);
13
}}
14