DevJourney · code I wrote while learning

README.md

806 B

Single File Programming Question

Problem Statement

Write a program that asks the user to enter two integers and then calculates the greatest common divisor (GCD) of the two numbers using an inline function. The GCD can be calculated using Euclid's algorithm.

Input format :

The input consists of two integers separated by space.

Output format :

The output displays the GCD of the two integers.

Refer to the sample output for formatting specifications.

Code constraints :

The given test cases fall under the following constraints:

1 ≤ integers ≤ 109

Sample test cases :

Input 1 :

4095 7168

Output 1 :

GCD of 4095 and 7168 is 7

Input 2 :

12 18

Output 2 :

GCD of 12 and 18 is 6

Input 3 :

255 999

Output 3 :

GCD of 255 and 999 is 3