/* * Assignement * Chapter 9 * By John Stile */ 1. Which of the following is/are TRUE? Assume xx=0 and yy=55 STATEMET RESULT a) (NULL) FALSE b) (!'0') FALSE c) (7-7) FALSE d) (!0) TRUE e) (xx=1) TRUE f) ('#') TRUE g) (!xx) TRUE h) if(((yy%2)==0) FALSE i) (xx=yy) TRUE 2. If aa=12, what is the value of aa after each of the following? STATEMET RESULT a) aa*=3 36 b) aa/=5 2 c) aa+=8 20 d) (aa*=2)%10 24%10 = 4 3. If x is an integer vaiable equal to 13, what is the value of STATEMET RESULT x%10 3 4. Assuming that xx and aa are int, and aa=3, what will be the values of xx and aa after STATEMET RESULT xx=aa++ xx=3, aa=4 5. What values of ee result in TRUE for the following STATEMET if ( ((ee>=90) && (ee<=95)) || ((ee>=10) && (ee<=25)) ) ANSWER: outer most () are for IF 2nd most () are for || 3rd most (), left are for && 3rd most (), right are for && we don't know what ee is. if ee is between 90 to 95, if is TRUE if ee is between 10 to 25, if is TRUE else, if is FALSE 6. Convert the following to a conditional opterator form: STATEMET if (aa>bb) { aa-- } else { aa++ } ANSWER: ( aa>bb ? aa--: aa++ )