0 votes 0 votes Assume object of int take 2 byte. What is output of above program. jatin saini asked Aug 19, 2017 jatin saini 407 views answer comment Share Follow See 1 comment See all 1 1 comment reply just_bhavana commented Aug 19, 2017 reply Follow Share Refer this https://gateoverflow.in/142618/please-solve-this-q 1 votes 1 votes Please log in or register to add a comment.
0 votes 0 votes The output should be 6. There needs to be a correction on line 5, it should be - char *p2=p1; Now, p1 will be incremented till the end of str. So in the end, p1 will be 6. And there will be no change in p2. So p2=0; Hence, it will return p1-p2=6-0=6 Shweta Nair answered Aug 19, 2017 Shweta Nair comment Share Follow See all 0 reply Please log in or register to add a comment.