What will be the output of the following code? int main() {
What will be the output of the following code?
#include <stdio.h>
int main() {
int arr[] = {1, 2, 3, 4, 5};
printf("%d %d \n", arr[2], *(arr + 2));
return 0;
}
Show answerHide answer
Correct answer: (A) 3 3
Explanation
arr[2] and *(arr + 2) both mean the third element, 3, so "3 3" is printed.