Program to find HCF & LCM of two numbers in C | #6 Coding Bytes
Вставка
- Опубліковано 6 вер 2024
- In this video, we will discuss the logic to find out LCM & HCF of two given numbers in C. If you want to know the solution to calculate LCM & GCD of given numbers in C++, Java and Python then check out the below links.
1) LCM of two numbers, LCM using GCD - bit.ly/2kM7Y4m
2) GCD of two numbers, GCD using Recursion - bit.ly/2mfvB5C
For more programming questions, check out this link - bit.ly/must-pra...
Also, to receive placement preparation tips and placement related updates on TCS, Accenture and various other companies. Come join the largest community on FACE’s Telegram and WhatsApp, and take your placement preparation to the next level.
Join here:
Telegram: t.me/faceprepo...
WhatsApp: bit.ly/2MgoYMR
Yup you have save my lots of time in single video. Thanks nice work .
HCF 3min video lcm 3min video . Here 9 min video...3min of your precious time got wasted? Sed!
....How did your code compile ? int "i" is not declared... is it c Compiler only or some other compiler ?
Yes originally i was not declared and it did throw an error, then i was initialized and compiled. Correcting the error was not shown in the video.
आपका पढ़ाने का तरीका बहुत ही अच्छा है बहुत ही शानदार है हमारी आपके साथ शुभ कामना है कि आप सभी की इसी तरह मदद करें और आप भी बहुत आगे जाएं
Please if possible then make a tutorial for pattern printing complex patterns two patterns together it will be very helpful for us .
Thankyou
Hi, we will soon make videos on pattern printing. However, you can also have a look at this for practice - www.faceprep.in/pattern-programs-in-c/
Tomorrow is my mid-sen and I'm watching this....😅😅😅
Bhai 9 bje est hai or 8.30 pe ye video dekh rha hu
Extremely helpful.. thanx for this vdo
You guys are my saving grace!!!!!THANK YOU!
Welcome!
good video mam tq ...
Explanation and coding is entire different
aren't all N>1 numbers divisible by i=1.
so gcd is gonna be 1 every time
Because in this for loop, we don't use break statement. So that i=1 will iterate till the last (greatest) i value that satisfies n1%i==0 && n2%i==0.
@@raveenak8581 Thank u🤗🥰
Thank you very mych
i is not declared and still the program got compiled,.... How?
Lol sis 🤣😂
Hey faceprep, please upload more videos on these type of topics. I watched so many videos but This playlist is best on youtube. Need more content please.
Thank You for all the love. We will upload very soon.
Thank you so so much
Wonderful logic 👍👍
So far best explanation
Nice explanation
mam why are we taking minimum value among n1 and n2 ???? that thing didnot clear
In that case if u take i value as 2 mean u will get the crt answer because by 1 both value will divise
That voice is amaaaazinnngggg
lcm and gcd for array how it will be?..can u explain
Your program took more time than expected.
Expected time limit
long gcd(long a,long b){
if(a==0)
return b;
else
return gcd(b%a,a);
}
int main() {
//code
int t;
cin>>t;
while(t--){
long a,b;
cin>>a>>b;
long hcf=gcd(a,b);
long lcm=(a*b)/hcf;
cout
How to use this loop in a function
Thanks
Thank you but font size is very little
Thanks for your feedback. We'll consider it.
I think everytime for every number the code will not work properly
i understood the logic but this video was totally useless for me, because i thought youwere going to teach the code, cus I already knew the logic btw thanks anyways
Can you please explain me this logic how it works for and if condition for find GCM
Can you please elaborate on GCM
Pls make a video for printing difficult patterns..
Hi, we will soon make videos on pattern printing. However, you can also have a look at this for practice - www.faceprep.in/pattern-programs-in-c/
plz can u explain gcd = i i have not understand
If the two numbers are completely divisible by i, then gcd will become i. That is what it indicates.
What's happens when there exists more than one number
@@yeswamthlepuru3068 then use break
Program is not getting executed
madam i declear to kr digye
How to calculate large power e.g 200^200 in c
@@tejask5417 no it doesn't work.
@@surajnath5148 by using pow function in c and u need to include math.h heterfile also.
Ma'am hindi me bolte to aur acche se samajh me aataa 😶
Saf dikhta ny hai mam
Isme output galat a raha hei
Hi, The output is exactly right. Kindly go through the video or let us know your question in detail.
Mene video kholi because I got a little crush on her 😁🤫🤪
Not good
I think your explanations are too fast
Thank you for your feedback. We'll consider it.