Interview Solution

There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult. C.A.R. Hoare

Greatest Common Divisor

Language Java | Level Intermediate | Category Interview Problems | July 24, 2015 4:52 pm

Comments


Interview Problem

Greatest Common Divisor (GCD) is the largest positive integer that divides the numbers without a remainder
Greatest common divisor (GCD) of two or more integers, when at least one of them is not zero, is the largest positive integer that divides the numbers without a remainder.
Example:-
The GCD of 8 and 12 is 4


Output

   					 
GCD of 8 and 12 is 4

				    

Comments



Please login to add comments.