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

Quiz: Number Programs in C · Question 1 of 10

For int n = 4507;, what are n % 10 and n / 10?

For int n = 4507;, what are n % 10 and n / 10?

  1. A.4 and 507
  2. B.7 and 450
  3. C.7 and 450.7
  4. D.45 and 7
Answer & explanation

Correct answer: 7 and 450

% 10 gives the last digit and integer division by 10 drops it.

Can you get the rest right without peeking?

Take the timed Quiz: Number Programs in C quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →