Sorting
October 28, 2023
Sorting
October 28, 2023
Sorting
October 28, 2023
Sorting
October 28, 2023

Pointers

Question 3
What is printed by the following ANSI C program?
#include
int main(int argc, char *argv[])
{
int x = 1, z[2] = {10, 11};
int *p = NULL;
p = &x;
*p = 10;
p = &z[1];
*(&z[0] + 1) += 3;
printf(“%d, %d, %d\n”, x, z[0], z[1]);
return 0;
}
A
1, 10, 11
B
1, 10, 14
C
10, 14, 11
D
10, 10, 14
Question 3 Explanation: 

Correct Answer: D
Question 3 Explanation: 

0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
error: Alert: Content selection is disabled!!