Which is the correct option for the following code?

1.7 Which is the correct option for the following code?
main() { char *str1="hello", *str2="hello";
if(str1==str2)
printf("equal");
else
printf("unequal"); }
A) Output is equal
B) Syntax error
C) Error because two pointers cannot be compared
D) Output is unequal

Leave a Reply