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

Quiz: COA Basics · Question 9 of 10

What does this print? (code)

What does this print?

instructions = 4_000_000
cpi = 2
clock_hz = 1e9
print(instructions * cpi / clock_hz * 1000, "ms")
  1. A.4.0 ms
  2. B.2.0 ms
  3. C.8.0 ms
  4. D.0.8 ms
Answer & explanation

Correct answer: 8.0 ms

CPU time = 4,000,000 × 2 / 1,000,000,000 s = 0.008 s = 8 ms.

Can you get the rest right without peeking?

Take the timed Quiz: COA Basics quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →