📚 Question Bank Q60 — Programming and Data Structure
Tags
Programming and Data Structure
Q60. Marks: +2.0 UGC NET Paper 2: Computer Science 7th Dec 2023 Shift 2

Consider the following code segment:

int arr[ ] = {0, 1, 2, 3, 4};

int i=1, *ptr;

ptr=arr + 2;

arrange the following printf statements in the increasing order of their output.

(A) printf("%d", ptr[i]);

(B) printf ("%d", ptr[i+1]);

(C) printf ("%d", ptr[-i]);

(D) printf ("%d", ptr[-i+1]);

Choose the correct answer from the options given below :

1.(C), (A), (B), (D)
2.(C), (D), (A), (B) ✓ Correct
3.(D), (A), (B), (C)
4.(A), (B), (D), (C)
📄 All “Programming and Data Structure” questions across papers
🏷 Change Tag for this Question