I'm writing a program that sorts 3 numbers that you have entered in an ascending order.
My problem is that if the first and third numbers happen to be the same, the program will output the second number twice. BUT I need the program to output all three numbers.
Ex. of what it's SUPPOSED to do:
Input
Enter first# 5
enter second# 2
enter third# 5
output
first number is 2
second number is 5
third number is 5
Ex. of what it is doing INSTEAD
input
first# 5
second# 2
third# 5
output
first number is 2
second number is 2 <-----Adds an extra 2 instead of the other 5
third number is 5
The program does some other sorting stuff, which is working ok. This is my lone problem.
If you can give me some pointers I'd appreciate it.
link to program
Scraps
My problem is that if the first and third numbers happen to be the same, the program will output the second number twice. BUT I need the program to output all three numbers.
Ex. of what it's SUPPOSED to do:
Input
Enter first# 5
enter second# 2
enter third# 5
output
first number is 2
second number is 5
third number is 5
Ex. of what it is doing INSTEAD
input
first# 5
second# 2
third# 5
output
first number is 2
second number is 2 <-----Adds an extra 2 instead of the other 5
third number is 5
The program does some other sorting stuff, which is working ok. This is my lone problem.
If you can give me some pointers I'd appreciate it.
link to program
Scraps