CSC161 2011S Imperative Problem Solving
[Skip to Body]
Primary:
[Front Door]
[Schedule]
[Piazzza]
-
[Academic Honesty]
[Instructions]
Current:
[Current Outline]
[Current EBoard]
-
[Current Assignment]
[Current Lab]
[Current Reading]
Groupings:
[Assignments]
[Documents]
[EBoards]
[Examples]
[Exams]
[Handouts]
[Labs]
[Outlines]
[Readings]
[Reference]
Related Courses:
[CSC195 2003S (Rebelsky)]
[CSC161 2009F (Coahran)]
[CSC161 2010S (Walker)]
[CSC161 2010F (Rebelsky)]
Misc:
[SamR]
[ISO]
[GNU Coding Standards]
Back to Control Flow: Conditionals (1). On to Control Flow: Loops.
This outline is also available in PDF.
Held: Friday, 25 February 2011
Summary: We consider additional forms of conditionals in C.
Related Pages:
Notes:
Overview:
Form:
switch (integer-expression):
{
case val0:
case val1:
statements;
case val2:
statements;
break;
default:
statements;
break;
} // switch
Meaning:
break, return, or the end of the
statement.
Useful because
fall throughoption is powerful (although dangerous).
Context:
if) can be used
to select between different sequences of instructions.
if?
Let x be the larger of y and z.
Form: test ? consequent : alternate
Meaning:
Examples
x = y *gt; z ? y : z;
Back to Control Flow: Conditionals (1). On to Control Flow: Loops.
[Skip to Body]
Primary:
[Front Door]
[Schedule]
[Piazzza]
-
[Academic Honesty]
[Instructions]
Current:
[Current Outline]
[Current EBoard]
-
[Current Assignment]
[Current Lab]
[Current Reading]
Groupings:
[Assignments]
[Documents]
[EBoards]
[Examples]
[Exams]
[Handouts]
[Labs]
[Outlines]
[Readings]
[Reference]
Related Courses:
[CSC195 2003S (Rebelsky)]
[CSC161 2009F (Coahran)]
[CSC161 2010S (Walker)]
[CSC161 2010F (Rebelsky)]
Misc:
[SamR]
[ISO]
[GNU Coding Standards]
Disclaimer:
I usually create these pages on the fly
, which means that I rarely
proofread them and they may contain bad grammar and incorrect details.
It also means that I tend to update them regularly (see the history for
more details). Feel free to contact me with any suggestions for changes.
This document was generated by
Siteweaver on Tue May 10 10:34:30 2011.
The source to the document was last modified on Wed Jan 5 12:52:12 2011.
This document may be found at http://www.cs.grinnell.edu/~rebelsky/Courses/CSC161/2011S/Outlines/outline.20.html.