What is the output of the following code snippet? int arr [10] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; int* ptr = arr; ptr + 5; ptr cout << *ptr << endl; - There is no output due to a compilation error. 4 5 6

icon
Related questions
Question
What is the output of the following code snippet?
int arr [10] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
int* ptr arr;
ptr ptr + 5;
cout << *ptr << endl;
There is no output due to a compilation error.
4
5
6
Transcribed Image Text:What is the output of the following code snippet? int arr [10] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; int* ptr arr; ptr ptr + 5; cout << *ptr << endl; There is no output due to a compilation error. 4 5 6
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer