- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathebob.java
More file actions
Latest commit
28 lines (24 loc) · 676 Bytes
/
Copy pathebob.java
File metadata and controls
28 lines (24 loc) · 676 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
importjava.util.Scanner;
publicclassebob {
publicstaticvoidmain(String[] args) {
intn1,n2;
Scannerinp = newScanner(System.in);
System.out.println("enter a number:");
n1 = inp.nextInt();
System.out.println("enter other number:");
n2 = inp.nextInt();
intmin = (n1 < n2) ? n1 : n2;
inti = 1;
intebob = min;
while(i <= min){
if((n1%i == 0) && (n2%i == 0)){
ebob = i;
}
i++;
}
intekok = n1*n2/ebob;
System.out.println("ebob:"+ebob);
System.out.println("ekok:"+ekok);
inp.close();
}
}