Presentation is loading. Please wait.

Presentation is loading. Please wait.

Relational Operators Etter, Engineering Problem Solving with C, Third Edition, © 2005 Pearson Education, Inc. All rights reserved. 0-13-142971-X.

Similar presentations


Presentation on theme: "Relational Operators Etter, Engineering Problem Solving with C, Third Edition, © 2005 Pearson Education, Inc. All rights reserved. 0-13-142971-X."— Presentation transcript:

1 Relational Operators Etter, Engineering Problem Solving with C, Third Edition, © 2005 Pearson Education, Inc. All rights reserved X

2 Logical Operators Etter, Engineering Problem Solving with C, Third Edition, © 2005 Pearson Education, Inc. All rights reserved X

3 Precedence for Arithmetic, Relational, and Logical Operators
Etter, Engineering Problem Solving with C, Third Edition, © 2005 Pearson Education, Inc. All rights reserved X

4 if (condition) statement 1;
Simple if Statement if (condition) statement 1; Etter, Engineering Problem Solving with C, Third Edition, © 2005 Pearson Education, Inc. All rights reserved X

5 if Statement with Compound Statement
if (condition) { statement 1; statement 2; statement 3; } Etter, Engineering Problem Solving with C, Third Edition, © 2005 Pearson Education, Inc. All rights reserved X

6 Flowcharts for Selection Statements
Etter, Engineering Problem Solving with C, Third Edition, © 2005 Pearson Education, Inc. All rights reserved X

7 if (condition) statement 1; else statement 2;
if/else Statement if (condition) statement 1; else statement 2; Etter, Engineering Problem Solving with C, Third Edition, © 2005 Pearson Education, Inc. All rights reserved X

8 Flowchart for if/else Statement
Etter, Engineering Problem Solving with C, Third Edition, © 2005 Pearson Education, Inc. All rights reserved X

9 Conditional Operator if (condition) statement1; else statement2;
condition ? statement1 : statement2; Etter, Engineering Problem Solving with C, Third Edition, © 2005 Pearson Education, Inc. All rights reserved X

10 Nested if/else Statements
if (code == 10) printf(“Too Hot\n”); else { if (code == 11) printf(“Caution\n”); if (code == 13) printf(“Turn on fan\n”); printf(“Normal Operation\n”); } Etter, Engineering Problem Solving with C, Third Edition, © 2005 Pearson Education, Inc. All rights reserved X

11 switch Statement switch (code) { case 10: printf(“Too Hot\n”); break;
printf(“Caution\n”); case 13: printf(“Turn on fan\n”); default: printf(“Normal Operation\n”); } Etter, Engineering Problem Solving with C, Third Edition, © 2005 Pearson Education, Inc. All rights reserved X

12 switch Statement switch (controlling expression) { case label_1:
. . . default: } Etter, Engineering Problem Solving with C, Third Edition, © 2005 Pearson Education, Inc. All rights reserved X

13 Program to Print a Table Using a while Loop
Etter, Engineering Problem Solving with C, Third Edition, © 2005 Pearson Education, Inc. All rights reserved X

14 Program to Print a Table Using a do-while Loop
Etter, Engineering Problem Solving with C, Third Edition, © 2005 Pearson Education, Inc. All rights reserved X

15 Program to Print a Table Using a for Loop
Etter, Engineering Problem Solving with C, Third Edition, © 2005 Pearson Education, Inc. All rights reserved X

16 Sea State Number Etter, Engineering Problem Solving with C, Third Edition, © 2005 Pearson Education, Inc. All rights reserved X

17 Plot of a Sine Function Etter, Engineering Problem Solving with C, Third Edition, © 2005 Pearson Education, Inc. All rights reserved X

18 Plot of Three Sinusoids
Etter, Engineering Problem Solving with C, Third Edition, © 2005 Pearson Education, Inc. All rights reserved X

19 Plot of Sums of Pairs of Sinusoids
Etter, Engineering Problem Solving with C, Third Edition, © 2005 Pearson Education, Inc. All rights reserved X

20 Plot of Combined Waves Etter, Engineering Problem Solving with C, Third Edition, © 2005 Pearson Education, Inc. All rights reserved X

21 A Linear Estimate to Model a Set of Points
Etter, Engineering Problem Solving with C, Third Edition, © 2005 Pearson Education, Inc. All rights reserved X

22 Distances Between Points and the Linear Estimate
Etter, Engineering Problem Solving with C, Third Edition, © 2005 Pearson Education, Inc. All rights reserved X

23 Equation for Least-Squares Slope
Etter, Engineering Problem Solving with C, Third Edition, © 2005 Pearson Education, Inc. All rights reserved X

24 Equation for Least-Squares y-intercept
Etter, Engineering Problem Solving with C, Third Edition, © 2005 Pearson Education, Inc. All rights reserved X

25 Atmospheric Layers Around the Earth
Etter, Engineering Problem Solving with C, Third Edition, © 2005 Pearson Education, Inc. All rights reserved X

26 Velocity and Altitude Data for a Weather Balloon
Etter, Engineering Problem Solving with C, Third Edition, © 2005 Pearson Education, Inc. All rights reserved X


Download ppt "Relational Operators Etter, Engineering Problem Solving with C, Third Edition, © 2005 Pearson Education, Inc. All rights reserved. 0-13-142971-X."

Similar presentations


Ads by Google