Simplify Complex Statements
One loop with complex conditions
for (A = 1; ((A-B < 4) && (A < 10)); A++)
{ . . . }
becomes two loops with simple conditions
/* if you know that B+4 < 10 */
for (A = 1; A < B+4; A++)
{ . . . }
for (; A < 10; A++)
{ . . . }
Previous slide
Next slide
Back to first slide
View graphic version