{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

CSE 123c notes

# CSE 123c notes - CSE 123C In addition to the power point on...

This preview shows pages 1–3. Sign up to view the full content.

CSE 123C February 18, 2008 In addition to the power point on HuskyCT Answers to quiz from Friday: 1. 7.8005 x 10 1  and -4.06 x 10 -4 2. y=sqrt(x); 3. x=(x+1)*y 4. x=x+(y-10) Practice! Write the non abbreviated form 1. x+= y=z*=2; 2. !(a=3*b); 3. x=x/++x; Answers: 1. x+=(y=(z*=2)); x=x+(y=(z=z*2)); z=z*2; y=z; x=x+y; 2. !(a==3*b); 3. x=x/(++x); If statement starts with  if (expression)  and ends with  } int x =1, k=5;      if (x>0)          k++

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
k--;  for this example, x>0, so you increment k, k=6, then you decrement k, k=5 int x=-1, k=5;      if (x>0)         k++      k--; for this example, x is not greater than 0, so you skip what’s indented and go straight to  the k--, decrement k, k=4 Short circuiting-evaluating as much of the expression as needed to get result, example-  or statements (if the first expression is true, you know the whole expression is true) If (d>0 && sqrt(d) > y)
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 4

CSE 123c notes - CSE 123C In addition to the power point on...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online