ECE 220 Lecture Notes - Lecture 8: Operand, Newline, Logical Conjunction

38 views5 pages

Document Summary

Automatic conversion will take place int x, a; double y, z: z=x+y; /* x converted to double, then you add */ a=x+y; /* x+y converted to int before assigning to a */ Caution: (a && b) differs from (a & b) is true. && and || are lazy or shortcutting if the result is known with 1 operand, the second operand is never evaluated. div_lt_10 = ((denom != 0) && ((num/denom) < 10)); Multiple operators y = x & z + 3 || 9 - w % 6; is the same as y = (x ^ (z+3)) || (9-(w%6)); Special operator: terinary operator (three arguments) (x ? y : z) (y) ? (x) : (y)) (well written macros have a lot of parenthesis because of order of operations)

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents