Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

7. Write a complete C++ program that does the following: Prompts the user for two positive integers. Call the first integer num1 and the

  image text in transcribed 

7. Write a complete C++ program that does the following: Prompts the user for two positive integers. Call the first integer num1 and the second integer num2 num2 must be less than half the value of num1 If num2 is larger than half the value of the num1, end the program Prints all numbers from 1 through num1 that are evenly divisible by num2 Then, prints all numbers from 1 through num2 that are not evenly divisible by num2 Sample run of program: Enter two integers. The second must be less than half the value of the first: 12 5 The numbers from 1 to 12 that are evenly divisible by 5 are: 5 10 The numbers from 1 to 12 that are not evenly divisible by 5 are: 1 2 3 4 6 7 8 9 11 12 Another sample run of the program: The second must be less than half the value of the first: 12 7 Enter two integers. Invalid input! Goodbye.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Accounting Principles

Authors: Jerry J. Weygandt, Paul D. Kimmel, Donald E. Kieso

9th Edition

978-0470317549, 9780470387085, 047031754X, 470387084, 978-0470533475

More Books

Students also viewed these Accounting questions