INSTRUCTIONS: Write a program that accepts a single integer input from the user.
ID: 3529764 • Letter: I
Question
INSTRUCTIONS:
Write a program that accepts a single integer input from the user. The program will then determine whether or not the number is prime. If the number is prime, a message indicating this is displayed. If the number is composite, a message indicating that the number is composite is displayed. In addition to this, the prime factors for the number are displayed. The prime factors do not have to be in order, but they must all be shown. For the sake of simplicity, we will only consider integers that are greater than or equal to 2 (x is on [2, ?) ? Z). If the user enters a number that is not within this range, display a message indicating that the number entered is not being considered.
PROGRAM NEEDS TO BEHAVE JUST LIKE EXAMPLES SHOWN BELOW!!
Explanation / Answer
#include #include #include using namespace std; int main() { double doubleNumber, doubleSquareRootOfNumber; int container = 0, counter = 1, number, squareRootOfNumber; bool flag = false, prime = false; cout > doubleNumber; coutRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.