When two strings are the same, what value does the strcmp() function return?
A. 0
B. 2
C. 1
D. Mistake
Answer:A
When two strings are the same, what value does the strcmp() function return?
A. 0 B. 2 C. 1 D. Mistake
Explanation: strcmp() in the C library compares two strings and returns the result.const char *str1, const char *str2) int strcmp(const char *str1) int strcmp(const char *str1) int strcmp(cons The first string (str1) and the second string (str2) are compared (str2).The function strcmp() returns the following values when comparing two strings:If str1 is less than str2, the result 0 is returned. Return value > 0 if str2 is less than str1. If str1 and str2 are equal, the return result is 0.