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

Programming Lecture 3.docx

3 Pages
Unlock Document

University of Waterloo
Computer Science
CS 137
Andrew Morton

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

Log In


Don't have an account?

Join OneClass

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

Sign up

Join to view


By registering, I agree to the Terms and Privacy Policies
Already have an account?
Just a few more details

So we can recommend you notes for your school.

Reset Password

Please enter below the email address you registered with and we will send you a link to reset your password.

Add your courses

Get notes from the top students in your class.