Class Notes (808,753)
CS 137 (16)
Lecture 3

# Programming Lecture 3.docx

3 Pages
97 Views

School
University of Waterloo
Department
Computer Science
Course
CS 137
Professor
Andrew Morton
Semester
Fall

Description
Programming Lecture 3 September 20, 2012 Operators  Relational o < less than o > greater than o <= less than or equal to o >= greater than or equal to  Equality o == equals o != not equals  Logical o ! not o || or  Short-circuits evaluation (evaluates left and may evaluate right) o && and  Short-circuits evaluation (evaluates left and may evaluate right)  Examples o (100>700)||(2<=7)  True  Evaluated both sub-expressions o (100>700)&(2<=7)  False  Evaluated left only o !(100>700)&&(2<=7)  True  Evaluated both sub-expressions  THE RELATIONAL, EQUALITY, AND LOGICAL OPERATORS RETURN 1 (TRUE) || 0 (FALSE) (i>-j)+(i==j) 0 ij 2 i==j Operators Precedence Associativity 1 Same as unary +, - Right Relational Less than the arithmetic operators Left Equality Less than the relational operators Left &&, || Less than the equality operators Right o i+j
More Less

Related notes for CS 137

OR

Don't have an account?

Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Join to view

OR

By registering, I agree to the Terms and Privacy Policies
Just a few more details

So we can recommend you notes for your school.