Any idea? Yes.
you are approaching the problem wrong
You know how to do flowcharts? trace tables? all these should be done before you think of coding. would you build a house without a blueprint?
Design a high level chart, something that will just follow the flow of the program, dont worry about the hard parts of it, just cover flow. once you know the flow, you work on each function. Something to check if the input is within range. then a function for each of the different options. After that you just set up your switch.
Here i'll start you off a bit.
this is the function for option
A:
well at least the way i'd do it
Code:
#include <iostream>
using namespace std;
bool CheckSwitch(int a, int b)
{
if ( a > b)
return true;
else
return false;
}
void SmalltoLarge(int a, int b, int c)
{
int temp;
if (CheckSwitch(c,b))
{
temp = c;
c = b;
b = temp;
}
if (CheckSwitch(b,a))
{
temp = a;
a = b;
b = temp;
}
if (CheckSwitch(c,b))
{
temp = b;
b = c;
c = temp;
}
cout<<a <<" " << b << " " << c <<endl;
}
int main()
{
SmalltoLarge(3,3,1);
int x;
cin>>x;
}