Given the code: int x; cout << "Enter an integer: "; cin >> x; Write a loop to print all numbers from 1 to x inclusive that are not factors of x. Example Output 1 Enter an integer: 12 5 7 8 9 10 11 Example Output 2 Enter an integer: 9 2 4 5 6 7 8

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter5: Looping
Section: Chapter Questions
Problem 9RQ
icon
Related questions
Question
100%

Given the code:
int x;
cout << "Enter an integer: ";
cin >> x;

Write a loop to print all numbers from 1 to x inclusive that are not factors of x.

Example Output 1
Enter an integer: 12
5 7 8 9 10 11

Example Output 2
Enter an integer: 9
2 4 5 6 7 8


Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Knowledge Booster
Types of Loop
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,