Write a C++ program that declares three variables minNum, midNum and maxNum to receive three integers read from the keyboard. The inputs are unsorted and can be read into the three variables in any order, for example, the first read number in minNum may not be the smallest. However, your program should then sort the three numbers to ensure minNum ≤ midNum ≤ maxNum and display them in this order.
1
Expert's answer
2012-09-18T10:37:12-0400
#include<iostream> using namespace std;
void f(float &x, float &y) { float t; t = x; x = y; y=t; } int main() { & float minNum,midNum,maxNum; & & cout <<" Enter minNum: "; & cin>>minNum; cout <<" Enter midNum: "; cin>>midNum; cout <<" Enter maxNum: " ; cin>>maxNum;
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment