🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← All topics

Quiz: Number Programs in C: questions with answers

10 questions, each with the answer and a short explanation.

Take the timed quiz + get a certificate →
  1. Q1. For int n = 4507;, what are n % 10 and n / 10?
  2. Q2. What does this print? (code)
  3. Q3. Why is 153 an Armstrong number?
  4. Q4. In a prime check, why is it enough to test divisors d while d d <= n?
  5. Q5. What does this print? (code)
  6. Q6. Why should a C program avoid pow() when checking Armstrong numbers?
  7. Q7. Which of these numbers is prime?
  8. Q8. Why is lcm = a / gcd(a, b) b better than a b / gcd(a, b)?
  9. Q9. What does this print? (code)
  10. Q10. Which number is a perfect number?