class 5 - • associativity – statement is read from left...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
accumulation operators void main() { int n1, n2; n1 = 1; n2 +=  2; n2 = 2; n2 *= n1 + 2; int e(0),      f(10),      ans; double dg(0.0); ans = ++e; ans = e++;  return e before it was incremented = 0, but e will go to value 1. operators return values. n1 = n2 = ans; ans = --f; f will become 9. ans = f--;  returns f before which now is 9 and then decrements to 8 ans = dg++; } precedence = operators which will be evaluated first. 
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: • associativity – statement is read from left to right when precedence is equal for multiple operators. #define PI acos(-1.0) { const double pi = acos(-1.0); double d1; d1 = cos(PI); } – preprocessor since it starts with #, with define it will sub in what we tell define to be...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online