0 votes 0 votes My answer is 42 but given answer is 2018 please explain how ? Programming in C programming-in-c programming + – Harikesh Kumar asked Jan 30, 2018 Harikesh Kumar 525 views answer comment Share Follow See all 5 Comments See all 5 5 Comments reply Raveena Yadav 1 commented Jan 30, 2018 reply Follow Share its correct ans is 2018 because mystery function is not changing any value..its just swapping the address that come in ptra ptrb..nowhere value is changing its not changing any value a b c d values remain same 0 votes 0 votes sumit goyal 1 commented Jan 30, 2018 reply Follow Share you got 42 because you assumed ,these below line , otherwise 2018 temp = *ptrb; *ptrb = *ptra ; *ptra = temp; 0 votes 0 votes hs_yadav commented Jan 30, 2018 reply Follow Share .....Debug the code segment carefully.... here mystrey function is not doing any thing.... mystrey(&a,&b).... here address of a and b would be transered to the tempa and tempb and then the value of tmpa and tempb is swapped not real address... 0 votes 0 votes Harikesh Kumar commented Jan 30, 2018 reply Follow Share Thanku bro now I got 0 votes 0 votes akash.dinkar12 commented Jan 31, 2018 reply Follow Share This question is just copied from gate 2016 question.. https://gateoverflow.in/39642/gate-2016-1-15 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes 2018 is the answer . mystery function do nothing because pointer is not associated with ptra and ptrb. sudhir singh answered Jan 31, 2018 sudhir singh comment Share Follow See all 0 reply Please log in or register to add a comment.