Python program to find the LCM and HCF of 2 numbers

preview_player
Показать описание
Music Credits:
Music: Joy
Musician: ASHUTOSH
Рекомендации по теме
Комментарии
Автор

THANKS FOR THE CODE


First we get two numbers from user stored as x and y.

Then we find the smaller number between the two.

We use a for loop to run the loop until it reaches value of the smaller number(no.of times=smaller number).

HCF is given the value of i which is highest value which satisfies condition.

As LCM into HCF is equal to product of two numbers, we can LCM by dividing product of x and y by HCF.
We then print the hcf and lcm respectively.

sleyyt
Автор

Great logic 👍
Sometimes not doing commentary confuses but it a marvel without saying a word.

concedethereality
Автор

too understanding for the begginers and so good👍🏻 🔰

aora
Автор

App name pls 😢😢
Saying it 6th time
I m your subscriber 😊❤

Baby_shark
Автор

def HCF(x, y)

return HCF

these 2 lines are missing if you just talk about HCF
LCM also has to be defined

Logic is good....🎉
In a small video almost all the things you covered

AjaySinghRawat-nqoo