ECS 30 Lecture Notes - Lecture 4: Infinite Loop, Switch Statement, Operand
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.