FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Java/lcm.java at main · Eggy115/Java · GitHub
Eggy115
/
Java
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
5
Star
3
Code
Issues
0
Pull requests
0
Discussions
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
Java
/
lcm.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
18 lines (15 loc) · 386 Bytes
Breadcrumbs
Java
/
lcm.java
Copy path
File metadata and controls
18 lines (15 loc) · 386 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
public
class
lcm
{
public
static
void
main
(
String
[]
args
) {
int
n1
=
72
,
n2
=
120
,
lcm
;
// maximum number between n1 and n2 is stored in lcm
lcm
= (
n1
>
n2
) ?
n1
:
n2
;
// Always true
while
(
true
) {
if
(
lcm
%
n1
==
0
&&
lcm
%
n2
==
0
) {
System
.
out
.
printf
(
"The LCM of %d and %d is %d."
,
n1
,
n2
,
lcm
);
break
;
}
++
lcm
;
}
}
}
Back
|
FazBrowse Home
|
New Git URL