-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmethodprct.java
More file actions
64 lines (53 loc) · 1.51 KB
/
Copy pathmethodprct.java
File metadata and controls
64 lines (53 loc) · 1.51 KB
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
63
64
public class methodprct {
// static int max(int x,int y){
// if(x>y)
// return x;
// else
// return y;
// }
// public static void main(String arg[]){
// int a=10,b=4;
// // methodprct mp=new methodprct();//
// // System.out.println(mp.max(a,b));//
// System.out.println(max(a, b));
// }
// static void inc(int x){
// x++;
// System.out.println(x);
// }public static void main(String[] args) {
// int a=10,b=15;
// inc(a);
// System.out.println(a);
// }
// PASSING OBJECTS//
// static void change(int A[],int index,int value){
// A[index]=value;
// }
// public static void main(String[] args) {
// int A[]={1,2,3,6,7};
// change(A,2,6);
// for (int x : A) {
// System.out.println(x);
// }
// }
// FINDING PRIME NUMBERS//
// static boolean isprime(int n){
// for(int i=2;i<n/2;i++){
// if(n%i==0)
// return false;
// }return true;
// }
// public static void main(String[] args){
// System.out.println(isprime(91));
// }
// "FINDING GCD/HCF"//
static int gcd(int m,int n){
while (m!=n) {
if(m>n)
m=m-n;
else n=n-m;
}return m;
}public static void main(String[]arg){
System.out.println(gcd(35,56));
}
}