Computer Science

Question

What is the output?Int x=2;x=x<<2;printf("%d ",x);

1 Answer

  • Here is your Answer:

    8

    Explanation:

    Int x=2;

    x=x<<2;

    printf("%d ",x);

    the value of x << 2, x shifted to left 2 times means x multiplied by 2 for 2 times, i.e. 2 * 2 * 2 = 8

You May Be Interested