View the step-by-step solution to:

Question

write program that prompts the user to enter two integers. The program outputs how many numbers are multiples of

3 and how many numbers are multiples of 5 between the two integers (inclusive). by using following structure

int main ()

{   

   int num1, num2;

   int multiple3Count = 0;

   int multiple5Count = 0;

   int temp;

...

...

...

while (temp <= num2)

{

     if (temp % 3 == 0)

           multiple3Count++;

...

...

...

...

}

   cout << "Multiples of 3 between " << num1

        << " and " << num2 << ": " << multiple3Count << endl;

...

...

return 0;

}

Top Answer

View the full answer
Capture.PNG

Sign up to view the full answer

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question