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

Info icon This 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?
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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern