Presentation is loading. Please wait.

Presentation is loading. Please wait.

Relational and Equality Operators Table 4-1. Sample Conditions Table 4-2.

Similar presentations


Presentation on theme: "Relational and Equality Operators Table 4-1. Sample Conditions Table 4-2."— Presentation transcript:

1 Relational and Equality Operators Table 4-1

2 Sample Conditions Table 4-2

3 Logical Operators And && (temperature > 90) && (humidity > 0.90) Or || (salary 5) Not ! !(0 <= n && n <= 100)

4 Operator Precedence Table 4.6

5 Sequential Flow A set of steps that are executed sequentially { statement; } statement

6 Selection Control Structure Execution path changes based on a condition Condition Do this Do something else FT

7

8 Character Comparisons Table 4.8

9 if Statement with One Alternative if (condition) action to perform if true; if (R != 0.0) current = voltage / R;

10 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");

11 Blocks if (condition) { statement; } else { statement; } if (condition) { statement; } else { statement; }

12 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;


Download ppt "Relational and Equality Operators Table 4-1. Sample Conditions Table 4-2."

Similar presentations


Ads by Google