Question
For C++ Write a program Smallest that reads three integers from the user and determines the smallest value. In this case, you are asking the
For C++
Write a program Smallest that reads three integers from the user and determines the smallest value.
In this case, you are asking the user to enter numbers, then tell them which one is the smallest. I am writing 6 test cases at the bottom.
It means you are running your code 6 times. The first time, your first number is 3, second number is 2, and the third number is 1. Your code should say, your smallest number is 1.
The second time when you run your code, your first number should be 1, the second is 2 and third is 3. The output should be 1.
in any test case, if you don't see the output 1, it means your code has some error. This program should work for any set of data.
Test Cases:
3 2 1
1 2 3
2 1 3
3 1 2
1 3 2
2 3 1
Note:
Once your code is running, try number -12, 12 and 0 as an input to check the output.
Submit only one OUTPUT.
ASSUME, NO TWO NUMBERS ARE SAME.
No need to turn in 6 outputs. For submission, one output is enough.
Continuation for the precious Exercise.
Repeat the Exercise Two. This time, instead of finding the smallest number, arrange them in ascending order (smallest to greatest). Please follow the algorithm that I have added in this module.
Hint: This time you are finding the smallest number, middle number, and the largest number. Display them in order. Use the same test case. Assume, no two numbers are same.
Note: Once your code is running, try number -12, 12 and 0 as an input to check the output.
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