Home / Expert Answers / Computer Science / what-is-the-output-of-the-following-code-fragment-int-x-5-4-6-0-10-8-y-5-z-x-x-4-x-1-pa971

(Solved): What is the output of the following code fragment?int x[5] = {4, -6, 0, -10, 8}, y = 5, z=x[x[4]+x[1 ...



  1. What is the output of the following code fragment?

    int x[5] = {4, -6, 0, -10, 8}, y = 5, z=x[x[4]+x[1]];
    z = x[1] - y / *x+1;
    printf("%d\n",z);

    A. 5
    B. -6
    C. -5
    D. It generates a compilation error
    E. None of the above
  2. Given the values unsigned char a = 0x35, b = 010, x = 200;
    What is the result [in binary] of the operation ~a^c<<b?

    A. 01001000
    B. 01001111
    C. 11100100
    D. 11001010
    E. None of the above
  3. What is the result of the following code fragment?

    int b = 6, p = &b, c = *p++;
    printf("%d\n", b>c?++*p:c-*p+5);

    A. 5
    B. 6
    C. 7
    D. unknown
    E. None of the above
  4. Assume you are in a secure server. Given short M[5][5]; what is the address that corresponds to the cell M[2][4] if the base address of M is 1256?

    A. 1288
    B. 1312
    C. 1276
    D. 1296
    E. None of the above
  5. What command creates cs271.tar which contains all files in the CS271 directory?

    A. tar -cf cs271.tar CS271
    B. tar cvf CS271 cs271.tar
    C. tar ctf cs271.tar CS271
    D. tar cvf -o cs271.tar CS271
    E. None of the above


We have an Answer from Expert

View Expert Answer

Expert Answer




We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe