Toggle navigation
Code Exercises
Interview Planner
Interview Guide
Practice Now
Blog
About
Easy
Moderate
Challenging
Fizz Buzz
Prime Number
Fibonacci Number
Palindrome Check
Even Fibonacci Sum
Greatest Common Divisor
Package Rice Bags
Filter Strings (Java 8 Lambdas and Streams)
Comma Separated (Java 8 Lambdas and Streams)
Ceasar Cipher
Strict Binary Tree Check
Two Sum (Pair with a Given Sum)
Greatest Common Divisor
The Greatest Common Divisor of two positive integers is the largest integer that divides both without remainder.
Write a method that returns the Greatest Common Divisor of p and q.
public Integer gcd(Integer p, Integer q) {
}
Submit
Clear
Solution