I am trying to write an if statement to test whether two conditions are both true. However, my code does not work when I combine the both tests into one if statement like:
if((last_smallest < samples[i]) && (samples[i] < current_smallest))
current_smallest = samples[i];
I know it is possible to have multiple tests in an if statement, but I simply have been unable to get it to work. When I use to nested if statements to the same effect as below, the program performs correctly.
if(last_smallest < samples[i])
if(samples[i] < current_smallest)
current_smallest = samples[i];
Anyone know what is going on??? Both snipets compile without issue.