Someone Please Help Me!

What's wrong with my code? I'm not allowed to use the && operator on this!

1
2
3
4
5
6
7
8
9
if (firstNumber > secondNumber)
					 if (firstNumber > thirdNumber)
						 txtLargest->Text = firstNumber.ToString();
					 else if (secondNumber > firstNumber)
						 if (secondNumber > thirdNumber)
							 txtLargest->Text = secondNumber.ToString();
						 else if (thirdNumber > firstNumber)
							 if (thirdNumber > secondNumber)
								 txtLargest->Text = thirdNumber.ToString();
bump
bump
1
2
3
4
5
6
7
std::string text_largest( int first, int second, int third )
{
    int largest = first ;
    if( largest < second ) largest = second ;
    if( largest < third ) largest = third ;
    return std::to_string(largest) ;
}
Your logic is genius. Really appreciate the help!
Last edited on
Topic archived. No new replies allowed.