exam review - a) storage duration b) scope c) linkage d)...

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

View Full Document Right Arrow Icon
4. Let f be the following function. What will be the value of f(10) if f has never been called before? What will be the value of f(10) if f has been called five times previously? Int f( int I) { static int j = 0; return I*j++; } 10. Which of the following declarations are legal? (Assume that PI is a macro that represents 3.14159) a) char c = 65; b) static int I = 5, j = I * I; c) float f = 2 * PI; d) double angles [] = {0, PI/2, PI, 3 * PI/2}; 11. Which kind of variables cannot be initialized? a) array variables b) enumeration variables c) structure variables d) union variables e) none of the above 12. What property of a variable determines whether or not it has a default initial value?
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: a) storage duration b) scope c) linkage d) type 7. Write the following functions: Unsigned int rotate_left(unsigned int I, int n); Unsigned int rotate_right(unsigned int I, int n); The value of rotate_left(I, n) should be the result of shifting the bits in I to the left by n places, with the bits that were “shifted off” moved to the right end of i. (For example, rotate_left(0x1234, 4) should return 0x2341 if integers are 16 bits long.) rotate_right should be similar, but “rotate” bits to the right instead of the left....
View Full Document

This note was uploaded on 04/26/2009 for the course EE 302 taught by Professor Mccann during the Fall '06 term at University of Texas.

Ask a homework question - tutors are online