/* * SelfTest1 * Chapter 9 * By John Stile */ 1. Which of the following are TRUE? Assume xx=0 and yy=9 a) (6) Answer:TRUE b) ('0') Answer:TRUE c) (7-3) Answer:TRUE d) (!43) Answer:FALSE e) (4-2-2) Answer:TRUE f) ('T') Answer:TRUE g) xx=0;(!xx) Answer:TRUE h) if ((yy%2)==0) Answer:FALSE 2. If the variable aa is equal to 5, what is the value of each of the following? a) aa*=7 Answer:35 b) aa/=2 Answer:2 c) aa+=4 Answer:9 d) (aa*=5)%=3 Answer:illegal lvalue. however: aa*=5; // resut 25 25%3 // result 1 3. Write a short program that demonstrates each aspect of the compound assignment operations listed in the previous section. 4. If a program uses srand(3) before each instance that it runs rand, will the number generateed by rand be different or the same each time it is run? Why? Answer: The same, because each time the same seed is used.