Problem Statement
How many two-digit numbers are divisible by 7?
Explanation
Two-digit numbers range from 10 to 99. We need to find how many numbers in this range are divisible by 7.
First two-digit number divisible by 7: 14 which is 7 times 2. Last two-digit number divisible by 7: 98 which is 7 times 14. This forms an arithmetic progression: 14, 21, 28, dot dot dot, 98 with first term a equals 14, common difference d equals 7, and last term l equals 98. Using AP formula: l equals a plus open parenthesis n minus 1 close parenthesis d. 98 equals 14 plus open parenthesis n minus 1 close parenthesis times 7. 84 equals open parenthesis n minus 1 close parenthesis times 7. n minus 1 equals 12. n equals 13.
Code Solution
SolutionRead Only
// Two-digit range: 10 to 99 // First number divisible by 7: // 10/7 = 1.42... → Next integer = 2 // 7 × 2 = 14 // Last number divisible by 7: // 99/7 = 14.14... → Integer part = 14 // 7 × 14 = 98 // Arithmetic Progression: // 14, 21, 28, ..., 98 // a = 14, d = 7, l = 98 // Formula: l = a + (n-1)d // 98 = 14 + (n-1)×7 // 84 = (n-1)×7 // n-1 = 12 // n = 13
Practice Sets
This question appears in the following practice sets:
