Q40
What will be the output of the following program? void main() char str1[] = "abcd"; char str2[] = "abcd"; if(str1==str2) printf("Equal"); else printf("Unequal");
A.
Equal
B.
Unequal
AnswerC.
Error
D.
None of these.
Answer: Option B
Solution
Answer: Option B
Solution:
Strings are compared using strcmp() function defined under string.h header file.