edited by
1,587 views
0 votes
0 votes

What will the following code fragment output:
 

void fun(int *a, int b)

{ 
    b++;
    a[2] = a[1] + 3;
}

void main()

{ 
    int A[5] = {0,1,2,3,4};
    fun(A, A[2]);
    printf(%d, A[2]);
}
edited by

4 Answers

Related questions

0 votes
0 votes
1 answer
3
shivam sharma 5 asked Aug 28, 2018
549 views
give the complete solution with explanationint main(){ int arr = {10,2,3,4,5,6,7,8}; int *p, *q; p = &arr ; q = (int*) arr; printf("%d ,%d \n",*p...
1 votes
1 votes
1 answer
4
pranay562 asked Jun 11, 2017
477 views
What is the output of above program?Answer is : 1, 1, 1, 12, 2, 2, 23, 3, 3, 32, 2, 2, 2 3, 3, 3, 34, 4, 4, 4Can anyone explain me those 4 expressions diagrammatically​...