What will be output of following program?
#include<stdio.h>
unsigned long int (* avg())[3]{
static unsigned long int arr[3] = {1,2,3};
return &arr;
}
int main()
{
unsigned long int (*ptr)[3];
ptr = avg();
printf("%d" , *(*ptr+2));
return 0;
}
(A) 1
(B) 2
(C) 3
(D) Compilation error
(E) None of above
#include<stdio.h>
unsigned long int (* avg())[3]{
static unsigned long int arr[3] = {1,2,3};
return &arr;
}
int main()
{
unsigned long int (*ptr)[3];
ptr = avg();
printf("%d" , *(*ptr+2));
return 0;
}
(A) 1
(B) 2
(C) 3
(D) Compilation error
(E) None of above