Answered step by step
Verified Expert Solution
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
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started