0 votes 0 votes please explain how the output is coming in both cases. Rudra Pratap asked Nov 22, 2018 Rudra Pratap 306 views answer comment Share Follow See all 4 Comments See all 4 4 Comments reply `JEET commented Nov 23, 2018 reply Follow Share As the addresses of the two variables are different in case of both the programs. So, on comparing them with each other will result in unmatching. Hence, both will print the else part. Example, Let's say the address of a is 100 and address of b is 200. In the first case when you will compare a and b, then it will compare the addresses of the first two variables. Similarly, in second case it will compare the addresses of the two variables. 0 votes 0 votes anjali007 commented Nov 23, 2018 reply Follow Share In this question the addresses of the given character arrays are being compared and not the values stored at them. And the same address can not be assigned to two different arrays or variables or anything for that matter so it would always fall into the else case . Had it been a reference to the other array or the values were compared it would have been another case. 0 votes 0 votes Rudra Pratap commented Nov 24, 2018 reply Follow Share in case of character pointer "if" part will run .thus match will be printed. and in case of character array "else" part will run actually. 0 votes 0 votes anjali007 commented Nov 24, 2018 reply Follow Share But in both the cases the addresses are being compared ... so where is the difference btw them? 0 votes 0 votes Please log in or register to add a comment.