Final answer:
The correct code to assign the number 3 to the 5th location in the array is D)*(p+4) = 3.
Step-by-step explanation:
The question is asking which line of code assigns the number 3 to the 5th location (index 4, as indexing starts at 0) in an integer array that has been dynamically allocated.
The line C)*(p+2) = 3; assigns the number 3 to the 3rd location (index 2), not the 5th. The correct answer is D)*(p+4) = 3; as it assigns the number 3 to the 5th location (index 4) in the dynamically allocated array pointed to by p.
The correct code to assign the number 3 to the 5th location in the array is D)*(p+4) = 3.