← 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 →- Q1. For int n = 4507;, what are n % 10 and n / 10?
- Q2. What does this print? (code)
- Q3. Why is 153 an Armstrong number?
- Q4. In a prime check, why is it enough to test divisors d while d d <= n?
- Q5. What does this print? (code)
- Q6. Why should a C program avoid pow() when checking Armstrong numbers?
- Q7. Which of these numbers is prime?
- Q8. Why is lcm = a / gcd(a, b) b better than a b / gcd(a, b)?
- Q9. What does this print? (code)
- Q10. Which number is a perfect number?