Lecture Summary 8
Prepared by: Anthony Larrain
These notes serve as an outline to the lecture, they are not intended to be complete.
Conditional Execution
- Want code to execute based on some condition.
- The general form of an if statement is.
if( BOOLEAN_TEST) { STATEMENTS_EXECUTED_IF_TRUE } else{ STATEMENTS_EXECUTED_IF_FALSE }
Relational Operators
Relational Operator | Definition |
---|---|
== | equal to |
!= | not equal to |
< | less than |
<= | less than or equal to |
> | greater than |
>= | greater than or equal to |
Logical Operators
&& and || or ! not