Skip to content
CampusEduX

Greatest Common Divisor

Easyjavapythonccppjavascript

Given two positive integers, find their greatest common divisor (GCD).

Input Format

A single line containing two integers A and B.

Output Format

Print the GCD of A and B.

Related Problems

  • Check Prime Number
    Easy · java, python, c, cpp, javascript
    Solve Problem
  • Least Common Multiple
    Easy · java, python, c, cpp, javascript
    Solve Problem
  • Count Digits and Digit Sum
    Easy · java, python, c, cpp, javascript
    Solve Problem

Input (stdin)

Output

Run your code to see output here...