Question

Using Python. Find the count of all numbers between 1 and 5,000,000 (inclusive) that are divisible...

Using Python.

Find the count of all numbers between 1 and 5,000,000 (inclusive) that are divisible by either one of 13, 17, 19, and is at the same time also even.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Code:

# Variable to keep count
c=0

# Using for loop for counting
for i in range(1,5000000):
if (i%2==0):
if(i%13==0 or i%17==0 or i%19==0 ):
c=c+1
  
# Printing the result   
print("Numbers between 1 and 5,000,000 (inclusive) that are divisible by either one of 13, 17, 19, and is at the same time also even :",c)

Code Screenshot:

Output:

Add a comment
Know the answer?
Add Answer to:
Using Python. Find the count of all numbers between 1 and 5,000,000 (inclusive) that are divisible...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT