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

If array p is located at address 4000 in memory, and each integer occupies 4 byt

ID: 3554893 • Letter: I

Question

  1. If array p is located at address 4000 in memory, and each integer occupies 4 bytes, show what the value of x will be after each of the following is executed. Assume that each statement starts with the original values of a and p given above.
        int x;    int p[5] = {7,11,2,12,17};    int *a = p; 
  2. x = ++*a;
  3. x = *++a;
  4. x = *a++;
  5. x = *(a++);
  6. x = (*a)++;
  7. What is output by the following program?
  •     #include     main()    {       int num = 10;       int *ptr = #       printf("%d %d ", num, *ptr);       num = 5;       printf("%d %d ", num, *ptr);       *ptr = 8;       printf("%d %d ", num, *ptr);    } 

Explanation / Answer

2) 8

3) 11

4) 8

5) 8

6) 8

7) 10 10

     5 5

     8 8

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote