If array p is located at address 4000 in memory, and each integer occupies 4 byt
ID: 3554893 • Letter: I
Question
- 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; - x = ++*a;
- x = *++a;
- x = *a++;
- x = *(a++);
- x = (*a)++;
- 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
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.