Answers 825
D
- a. Good
b. Not legal
c. Legal, but a bad choice
d. Good
e. Legal, but a bad choice
Exercises ........................................................................................................
- The following are appropriate answers for each:
a. unsigned short int
b. unsigned long intor unsigned float
c. unsigned double
d.unsigned short int - The following are possible answers:
a. myAge
b. backYardArea
c. StarsInGalaxy
d.averageRainFall - The following is a declaration for pi:
const float PI = 3.14159; - The following declares and initializes the variable:
float myPi = PI;
Day 4....................................................................................................................
Quiz ................................................................................................................
- An expression is any statement that returns a value.
- Yes, x = 5 + 7 is an expression with a value of 12.
- The value of 201 / 4 is 50.
- The value of 201 % 4 is 1.
- Their values are myAge: 41,a: 39,b: 41.
- The value of 8+2*3 is 14.
7.if(x = 3)assigns 3 to xand returns the value 3 , which is interpreted as true.
if(x == 3)tests whether xis equal to 3 ; it returns true if the value of xis equal to
3 and false if it is not.
32 0672327112_app_d.qxd 11/19/04 12:30 PM Page 825