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

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

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.
@kamalanb6930
@kamalanb6930 5 жыл бұрын
Thanks a lot. It was really helpful 😊
@ibrahimshaikh9179
@ibrahimshaikh9179 3 жыл бұрын
Well explained sir✌
@munidinesh9775
@munidinesh9775 2 жыл бұрын
thanks bigtime
@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.
@worldnewsvideos
@worldnewsvideos 4 жыл бұрын
thank you
@mustapharaimilawal8053
@mustapharaimilawal8053 4 жыл бұрын
Hello Sir, thanks for this awesome tutorial, can you please solve some java interview questions on singly linked list? Thank you.
@yosiefberhe4974
@yosiefberhe4974 3 жыл бұрын
Can it be done by while loop too? i have a problem with the while loop, it kind of confuse me?
@allenrubiks4166
@allenrubiks4166 3 жыл бұрын
Sir, Is this program a kind of recursive function???
@yashwantbhagawat2710
@yashwantbhagawat2710 4 жыл бұрын
what will be the time complexity of this program
@pinkubose2994
@pinkubose2994 Жыл бұрын
10 is also divisible by 10. Means why don't you include number itself as a factor !
@aqua6150
@aqua6150 4 жыл бұрын
Beautifully explained. But its less beautiful then Me.
@akshatpanwar6260
@akshatpanwar6260 4 жыл бұрын
Take 2 numbers 22 and 7 you will not get ans
@mallikasome9407
@mallikasome9407 3 жыл бұрын
Because they don't have any common factors
@SroCounter
@SroCounter 3 жыл бұрын
@@mallikasome9407 1?
Java code for Converting Decimal Number to Binary Number
14:50
TrainingMug
Рет қаралды 13 М.
Python Tutorials - Program To Find out the GCD of Two Positive Numbers
13:11
My little bro is funny😁  @artur-boy
00:18
Andrey Grechka
Рет қаралды 13 МЛН
Василиса наняла личного массажиста 😂 #shorts
00:22
Денис Кукояка
Рет қаралды 10 МЛН
I wish I could change THIS fast! 🤣
00:33
America's Got Talent
Рет қаралды 105 МЛН
How to Find the Greatest Common Divisor of 9 and 24
1:05
The Math Sorcerer
Рет қаралды 4,9 М.
Program to find GCD 0f 2 numbers and GCD of N numbers or GCD of an Array
10:24
Java Greatest Common Divisor Program: GCD Eucleadians Algorithm
4:33
Java code for Printing Multiplication Table from 1 to 10
9:27
TrainingMug
Рет қаралды 12 М.
Solve any Factor Program in 10 minutes
8:26
Simply Coding
Рет қаралды 33 М.
Recursion in Programming - Full Course
1:51:36
freeCodeCamp.org
Рет қаралды 928 М.
Java code to Convert Binary Number to Decimal Number
11:37
TrainingMug
Рет қаралды 16 М.
Greedy Algorithms Tutorial - Solve Coding Challenges
1:53:09
freeCodeCamp.org
Рет қаралды 309 М.
The Algorithm Behind Spell Checkers
13:02
b001
Рет қаралды 406 М.
My little bro is funny😁  @artur-boy
00:18
Andrey Grechka
Рет қаралды 13 МЛН