Sort numbers

Write your question here.
I am trying to make a code that will sort numbers in order, what is wrong with this code. I am not a computer guy, and this is my last class before I graduate so I need all the help I can get
[code]
Put the code you need help with her
///////////////////////////////////////////////////////////////////
// Student name:
// Course:
// Assignment:
// File name:
// Purpose:
//
// Assumptions: The user needs to enter three integer values
//
// Limitations: The program only handles integers as input
//
// Development Computer:
// Operating System:
// Compiler: Gnu g++
// Integrated Development Environment (IDE): Dev C++
// Operational Status:
///////////////////////////////////////////////////////////////////

#include <iostream>
#include <stdlib.h>

using namespace std;


// ################################################################
int main(void)
{
double valueA;
double valueB;
double valueC;
double temp;


cout << "enter valueA, enter valueB, enter valueC";
cin >> valueA >> valueB >> valueC;
if valueA > valueB then swap valueA and valueB
{
temp = valueA;
}
if valueB >>valueC then swap valueB and valueC
{
temp = valueB
}
if valueA > valueB then swap valueA and valueB
{
temp = valueA
}

return 0;
} // End main
Last edited on
1. The limitation said it only handled integer, why do you still use double?
2. Where is your swap?
temp = valueA/valueB/valueC is not a swap

swap is, for example, X, Y
restore X value,
then assign Y value to X,
put restored X value into Y.
Topic archived. No new replies allowed.