🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Number Theory for Coding: all 10 questions

Quiz: Number Theory for Coding · Question 2 of 10

What does this print? (code)

What does this print?

import math
print(math.gcd(48, 36), 48 * 36 // math.gcd(48, 36))
  1. A.6 288
  2. B.12 1728
  3. C.4 432
  4. D.12 144
Answer & explanation

Correct answer: 12 144

gcd(48, 36) = 12, and lcm = 48 × 36 / 12 = 144.

Can you get the rest right without peeking?

Take the timed Quiz: Number Theory for Coding quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →