Trying to find largest number

I am trying to find the largest number from a set of three user-inputted integers. I started c++ one week ago, so simple solutions would be appreciated. I have debugged and tried my hardest to resolve it on my own, but as I mentioned I am very new to the language. Thanks in advance!

1
2
3
4
5
6
7
8
9
10
11
int big;
	if (integerOne > integerTwo && integerThree)
		big = integerOne;

	else if (integerTwo > integerOne && integerThree)
		big = integerTwo;

	else (integerThree > integerOne && integerTwo);
		big = integerThree;

	cout << big;
You need to test for the larger number on both sides of the &&. Also, else does not test any condition. Try this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <iostream>
using namespace std;


int main()
{
	const int integerOne = 5, integerTwo = 6, integerThree = 3;

	int big;
	if (integerOne > integerTwo && integerOne > integerThree) {
		big = integerOne;
	}

	else if (integerTwo > integerOne && integerTwo > integerThree) {
		big = integerTwo;
	}

	else {
		big = integerThree;
	}

	cout << big << endl;


	return 0;
}
@joe864864, thanks a lot! That was a very quick, sufficient answer. I really appreciate the help.
Topic archived. No new replies allowed.