I am fairly new to coding, and I just can't figure out what I did wrong. It's a fairly simple assignment...
Code:
#include<iostream>
using namespace std;
int main() {
double a, b, c, temp;
cout << "Enter three numbers: ";
cin >> a >> b >> c;
if( a>b ) {
temp = a;
a = b;
b = temp;
}
if( b>c ) {
temp = b;
b = c;
c = temp;
}
if( a>b) {
temp = a;
a = b;
b = temp;
}
cout << a << " " << b << " " << c << endl;
return 0 ;
}
The error is :
Code:
unix2% g++ -o sort3 sort3.cpp (Input)
sort3.cpp:8: error: parse error before numeric constant (Output)