ECS 30 Lecture Notes - Lecture 4: Infinite Loop, Switch Statement, Operand

44 views2 pages

Document Summary

Else is a form of control statement that has to be paired with if. If the statement is false, then the else statement will be executed. If the blocks are composed of one statement, then the braces can be omitted. However, it is not recommended to omit braces. You can declare variables and make the inside of statements complex. Using multiple sets of double quotes will allow you to compactify long printf statements. Placements of variables can be placed with operations of variables instead of just a variable. If statements can be nested within each other. A leading whitespace before a variable assignment, will discard the input that fills in that space. Cascading if statements are more or less the else if statements. Order matters because all are executed in order until a match is found. It will stop when it finds the match. You can call the functions within the if statements.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents