78.7k views
3 votes
How many three-digit numbers are divisible by 17 write a program to print them

User Kites
by
6.8k points

1 Answer

7 votes

To find out how many three-digit numbers are divisible by 17, we need to count the number of multiples of 17 between 100 and 999. We can do this by dividing 999 by 17 and rounding down to the nearest whole number:

999 ÷ 17 = 58.7647

So there are 58 multiples of 17 between 100 and 999.

To print these numbers, we can use a loop to check each three-digit number and print it if it is divisible by 17. Here's an example program in Python:

for i in range(100, 1000):

if i % 17 == 0:

print(i)

This program uses a for loop to iterate over each number from 100 to 999. The if statement checks whether each number is divisible by 17 using the modulo operator (%). If the remainder is 0, the number is divisible by 17 and is printed to the console.

User Mehrdad Pedramfar
by
8.0k points