Fatal Error C1075

I'm still learning C++ and in class we were tasked to make a program to have the user input 3 numbers and have the output showing them in ascending order. Using the letters a, b, and c for cin I did a bit of coding using If Else and I keep getting an error. Someone please help, I'm confused.

#include <iostream>

using namespace std;

int a, b, c;

void main()

{
cout << "Please enter three integer values." << endl;
cout << "Press enter after each value." << endl;

cin >> a >> b >> c;


if (a > b)
{
if (b > c)
{
cout << c << b << a;
}
else if (a > c)
{
cout << b << c << a;
}
else
{
cout << b << a << c;
}
}
else if (b > c)
{
if (a > c)
{
cout << c << a <<b;
}
else
{
cout << a << c << b;
}
}
else
{
cout << a << b << c;
}
You're missing the } for the end of main.
If you had used sensible indentation, this would have been obvious.

BTW, just posting "Error C1075" is not helpful. Different compilers use different error numbers. In the future, please post the full text of the error message.

PLEASE USE CODE TAGS (the <> formatting button) when posting code.
It makes it easier to read your code and also easier to respond to your post.
http://www.cplusplus.com/articles/jEywvCM9/
Hint: You can edit your post, highlight your code and press the <> formatting button.

Last edited on
Topic archived. No new replies allowed.