Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1) << and >> are left shift and right shift operator in C. Assuming a is a 32 bi

ID: 3671178 • Letter: 1

Question

1)                 << and      >>       are      left       shift     and      right    shift     operator         in         C.      Assuming       a          is         a          32        bits      integer,           and      given   the      following        code    snippet:         

int I =520;

a = a << 2;

a = a >> 3:

What are the results of a in each line?

int   a = 520;                                  a=        ___________       

    a = a << 2;                                                                                                                                                   a=        ___________                   

    a = a >> 3;                                                                                                                                                     a=     

     

     

Explanation / Answer

int a =520 ; Result : 520

a = a << 2; Result : 2080

a = a >> 3: Result : 65