Dsa
Math
Easy
Find GCD and LCM
Given two integers A and B, write a program that computes both their greatest common divisor (GCD) and least common multiple (LCM). The output should print both values on a single line separated by a space.
Example:
Input:
8 12
Output:
4 24
Key concepts
mathgcdlcm
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now