Question: Create a program that asks the user to enter two integers. The program counts how many integers between the two entered numbers ( inclusive )

Create a program that asks the user to enter two integers. The program counts how many integers between the two entered numbers (inclusive) are multiples of 2 or 3 and how many integers between the two entered numbers (inclusive) are not multiples of either 2 or 3. The program then displays the counts to the user.
For example, if the user enters 3 and 20, the outputs are 12(there are 12 multiples of either 2 or 3 between 3 and 20) and 6(there are 6 numbers between 3 and 20 that are not multiples of either 2 or 3).
For simplicity, assume that the user always enters the smaller number first. That is, assume the first input by the user is less than the second input by the user. So, in the above example, assume 3 is entered first and 20 is entered second.
Remember, you can use themod block to check if a number X is a multiple of another number Y by checking that the remainder when the X is divided by Y is 0. The mod block returns the remainder when the number X entered on the left side of the block is divided by the number Y entered on the right side. For X to be a multiple of Y, the output from the modblock must be 0.
Note:For full credit the inputs and outputs must include appropriate sentences.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!