I've got an easy question for the experts.
I'm comparing two conditions for a result to happen but I think I have the else's and if's logic wrong:
If I have:
if (a > b && c < 10)
do this;
Only the if a > b condition is being seen and the do this; only executes with that parameter. The && c < 10 is being ignored.
I've also used:
if ((a>b) && (c < 10))
do this;
and
if (a>b) && (c < 10)
do this;
Same results, only the if a>b is 'seen' and the c < 10 is ignored.
Both must be valid for do this; to happen.
Any thoughts???
I'm comparing two conditions for a result to happen but I think I have the else's and if's logic wrong:
If I have:
if (a > b && c < 10)
do this;
Only the if a > b condition is being seen and the do this; only executes with that parameter. The && c < 10 is being ignored.
I've also used:
if ((a>b) && (c < 10))
do this;
and
if (a>b) && (c < 10)
do this;
Same results, only the if a>b is 'seen' and the c < 10 is ignored.
Both must be valid for do this; to happen.
Any thoughts???