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]); } Programming in C iiith-pgee-samplequestion + – Ismail asked Apr 5, 2018 edited Apr 7, 2018 by Subarna Das Ismail 1.6k views answer comment Share Follow See all 2 Comments See all 2 2 Comments reply gauravkc commented Apr 5, 2018 reply Follow Share 4? a[1] =1, 1+3=4 1 votes 1 votes Ismail commented Apr 5, 2018 reply Follow Share don't know the actual answer but i also got 4 fun(A,A[2]) is like fun(passing array address, passing just value at A[2]) so we don,t care about b++ and a[2] = a[1] + 3 = 1+3=4 0 votes 0 votes Please log in or register to add a comment.
3 votes 3 votes output=4. abhishekmehta4u answered Apr 5, 2018 abhishekmehta4u comment Share Follow See all 0 reply Please log in or register to add a comment.
2 votes 2 votes a[2] = 2, a[1]= 1, a[2]= a[1] + 3, ==> a[2] = 1+3 = 4 dixit bishwash answered Apr 9, 2018 dixit bishwash comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes A[2]=a[1]+3=1+3=4 Answer 4 tanmay jawkhede answered Apr 5, 2018 tanmay jawkhede comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes Output is 4. Sachin Yadav 4 answered Jun 5, 2019 Sachin Yadav 4 comment Share Follow See all 0 reply Please log in or register to add a comment.