That's what the < operator is for, alternatively, you could say num4 > num2 if you're just dead set on using the greater than operator. I'll let someone more familiar with C++ specifically chime in, but I don't believe you can create a conditional using the ! like that. You may be able to do if(!(num2 > num4))??