Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hello there! I have this C++ task I cannot get it right: I need a program that divides the given user input into two factors

Hello there!

I have this C++ task I cannot get it right:

I need a program that divides the given user input into two factors that are as close as possible to each other.

At first, the program asks for a positive number (input). If zero or a negative number is given as input, the program prints "Only positive numbers accepted". Otherwise, the program prints the product and its two factors. The smaller of the factors is printed first. It is crucial that the two factors that make up the multiplication are numerically as close to each other as possible. I have provided pictures of the desired output below. Notice how 16 is 4*4, not 1*16 or 2*8. The output needs to be exactly like given in the pictures so please test with those numbers so that it is correct.

image text in transcribed

Thank you so much in ahead!

Enter a positive number: 20 20=45 Enter a positive number: 16 16=44 Enter a positive number: 5 5=15 Enter a positive number: 60 60=610 Enter a positive number: 0 Only positive numbers accepted

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_2

Step: 3

blur-text-image_3

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

Current Trends In Database Technology Edbt 2004 Workshops Edbt 2004 Workshops Phd Datax Pim P2panddb And Clustweb Heraklion Crete Greece March 2004 Revised Selected Papers Lncs 3268

Authors: Wolfgang Lindner ,Marco Mesiti ,Can Turker ,Yannis Tzitzikas ,Athena Vakali

2005th Edition

3540233059, 978-3540233053

More Books

Students also viewed these Databases questions

Question

Describe the five elements of the listening process.

Answered: 1 week ago