C | Arrays | Question 4

Last Updated :
Discuss
Comments
Output of following program? C
#include<stdio.h> 
  
int main() 
{ 
  int a[] = {1, 2, 3, 4, 5, 6}; 
  int *ptr = (int*)(&a+1); 
  printf("%d ", *(ptr-1) ); 
  return 0; 
}
1
2
6
Runtime Error
Tags:
Share your thoughts in the comments