-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathebobekok.java
More file actions
41 lines (36 loc) · 1006 Bytes
/
ebobekok.java
File metadata and controls
41 lines (36 loc) · 1006 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
import java.util.Scanner;
public class ebobekok {
public static void main(String args[]) {
Scanner input=new Scanner(System.in);
System.out.println("Sayı Giriniz:");
int x=input.nextInt();
System.out.println("Sayı Giriniz:");
int y=input.nextInt();
if(x>y){
int a=y;
while(true){
if(x%a==0 && y%a==0 ){
System.out.println("EBOB:"+a);
System.out.println("EKOK:"+(x*y)/a);
break;
}
else{
a--;
}
}
}else{
int a=x;
while(true){
if(y%a==0 && x%a==0 ){
System.out.println("EBOB:"+a);
System.out.println("EKOK:"+(x*y)/a);
break;
}
else{
a--;
}
}
}
//EKOK = (n1*n2) / EBOB
}
}