19.9k views
5 votes
Loop zirough al integers from t to 1,050,000. For all integers fron 1 to 9 , count how many values are divisible by each heger. Frint out the count for each infeger. - This program does not accept inpat. a Arrays may not be used. Copy and paste wat help cut down on typing - Hint. value 1% value 2=0 wil fetum true when valuet is alveibie by valie?

User Epattaro
by
7.9k points

1 Answer

4 votes

Final answer:

To count how many values between 1 and 9 are divisible by each integer from t to 1,050,000, use a loop starting from t and going up to 1,050,000. Check if each integer is divisible by values from 1 to 9 using the modulo operator, and count the number of such integers for each value.

Step-by-step explanation:

To count how many values between 1 and 9 are divisible by each integer from t to 1,050,000, you can use a loop. Start the loop from t and go up to 1,050,000. For each integer, check if it is divisible by values from 1 to 9 using the modulo operator (%). If the remainder is 0, it means the integer is divisible by that value. Count the number of such integers for each value, and print out the count.

User Andre Albert
by
7.5k points