← 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?
- A.4 and 507
- B.7 and 450
- C.7 and 450.7
- 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 →