-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmethod01.java
More file actions
62 lines (29 loc) · 899 Bytes
/
method01.java
File metadata and controls
62 lines (29 loc) · 899 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
public class method01{
public static int[] listofFactor(int a){
int[] x = new int[n];
for (int i = 1, j = 0; i <= n; i++ ){
if(n % i == 0){x[j] = i; j++;}
}
return null;
}
public static int sumOfItems(int[] list) {
int sum = 0;
for (int i = 0; i < list.length; i++){
sum = list[i] + sum;
}
return sum;
}
public static boolean isPrime (int a, int b) {
return true;
}
public static int computeGCD(int a, int b){
for (int i = a ; i > 1; i--){
if((a % i == 0) && (b % i == 0)) return i;
}
return 1;
}
public static void main(String[] args) {
int c = computeGCD(8, 12);
System.out.println(c);
}
}