Relational and Equality Operators Table 4-1
Sample Conditions Table 4-2
Logical Operators And && (temperature > 90) && (humidity > 0.90) Or || (salary 5) Not ! !(0 <= n && n <= 100)
Operator Precedence Table 4.6
Sequential Flow A set of steps that are executed sequentially { statement; } statement
Selection Control Structure Execution path changes based on a condition Condition Do this Do something else FT
Character Comparisons Table 4.8
if Statement with One Alternative if (condition) action to perform if true; if (R != 0.0) current = voltage / R;
if Statement with Two Alternatives if (condition) action to perform if true; else action to perform if false; if (voltage > 3.3 ) printf(A digital High is present!"\n); else printf(A digital Low is present!\n");
Blocks if (condition) { statement; } else { statement; } if (condition) { statement; } else { statement; }
Nested if Statements if (x > 0) num = num + 1; else { } if (x < 0) num_neg = num_neg + 1; else /* x equals 0 */ num_zero = num_zero + 1;