Java code for Finding GCD ( Greatest Common Divisor ) or GCF of two numbers

  Рет қаралды 28,802

TrainingMug

TrainingMug

6 жыл бұрын

This program demonstrates the logic and code for finding GCD ( Greatest Common Divisor ) or GCF ( Greatest Common Factor ) for the given two numbers.
Example: for 10, 15 , the GCD is 5 and for 36,60 the GCD is 12.
This program we have implemented using Euclidiean algorithm based on subtraction and division.
If you like this video, don't forget to subscribe , like and share this video
Please promote this channel , by sharing it with your friends who are searching / preparing for IT jobs in programming..
If you have any coding challenges ( questions ) , post them in the comment, we will upload the videos for the same

Пікірлер: 18
@codewaythamizha4173
@codewaythamizha4173 2 жыл бұрын
Thankyou
@dristidugar6311
@dristidugar6311 2 жыл бұрын
SUPERB explanation.
@gitamittala2795
@gitamittala2795 6 жыл бұрын
The GCD OF ZERO AND A NON-ZERO NUMBER IS , NON ZERO NUMBER. EX: gcd(a,0) is a, not zero.The first if Clause is wrong.
@gitamittala2795
@gitamittala2795 6 жыл бұрын
You should have use AND operator instead of OR operator in first if statement.
@ibrahimshaikh9179
@ibrahimshaikh9179 3 жыл бұрын
Well explained sir✌
@kamalanb6930
@kamalanb6930 5 жыл бұрын
Thanks a lot. It was really helpful 😊
@munidinesh9775
@munidinesh9775 2 жыл бұрын
thanks bigtime
@mustapharaimilawal8053
@mustapharaimilawal8053 4 жыл бұрын
Hello Sir, thanks for this awesome tutorial, can you please solve some java interview questions on singly linked list? Thank you.
@pinkubose2994
@pinkubose2994 Жыл бұрын
10 is also divisible by 10.
@worldnewsvideos
@worldnewsvideos 4 жыл бұрын
thank you
@allenrubiks4166
@allenrubiks4166 3 жыл бұрын
Sir, Is this program a kind of recursive function???
@yosiefberhe4974
@yosiefberhe4974 3 жыл бұрын
Can it be done by while loop too? i have a problem with the while loop, it kind of confuse me?
@aqua6150
@aqua6150 4 жыл бұрын
Beautifully explained. But its less beautiful then Me.
@yashwantbhagawat2710
@yashwantbhagawat2710 4 жыл бұрын
what will be the time complexity of this program
@akshatpanwar6260
@akshatpanwar6260 4 жыл бұрын
Take 2 numbers 22 and 7 you will not get ans
Python Tutorials - Program To Find out the GCD of Two Positive Numbers
13:11
Java code for Converting Decimal Number to Binary Number
14:50
TrainingMug
Рет қаралды 13 М.
WORLD'S SHORTEST WOMAN
00:58
Stokes Twins
Рет қаралды 128 МЛН
IQ Level: 10000
00:10
Younes Zarou
Рет қаралды 11 МЛН
Каха заблудился в горах
00:57
К-Media
Рет қаралды 10 МЛН
How to Find the Greatest Common Divisor of 9 and 24
1:05
The Math Sorcerer
Рет қаралды 5 М.
Java code for Printing Multiplication Table from 1 to 10
9:27
TrainingMug
Рет қаралды 12 М.
Java Program #29 - Find GCD of two Numbers in Java
10:43
Programming For Beginners
Рет қаралды 3,9 М.
Java Greatest Common Divisor Program: GCD Eucleadians Algorithm
4:33
Factorial Program in Java with Recursion #70
9:48
Alex Lee
Рет қаралды 102 М.
Solve any Factor Program in 10 minutes
8:26
Simply Coding
Рет қаралды 34 М.
Java code to Convert Binary Number to Decimal Number
11:37
TrainingMug
Рет қаралды 16 М.
WORLD'S SHORTEST WOMAN
00:58
Stokes Twins
Рет қаралды 128 МЛН