Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a201851

Browse files
completed gcd lcm
1 parent f81d850 commit a201851

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

‎Day 5/gcd-lcm.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
x = int(input('Enter the first number: '))
2+
y = int(input('Enter the second number: '))
3+
4+
a, b = x, y
5+
while b != 0:
6+
a, b = b, a%b
7+
8+
print(f'GCD: {a}')
9+
print(f'LCM: {x * y // a}')
10+
11+
# print('GCD:', a, sep='@')
12+
# print('GCD: ' + str(a))

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /