What will be output of following program of C?


#include
void main()
{
int arr[]={1,2,3,4,5,6};
void xxx(int[5]);
xxx(arr);
}
void xxx(int ch[5])
{
printf("%d",-1[ch]);
}



Output: -2
Explanation:
We are passing the array by xxx function. 1[ch] means *(ch+1) which is ch[1] =2.

No comments:

Post a Comment