What value strcmp() function returns when two strings are the same? A. 0 B. 2 C. 1 D. Error Answer Workspace Report Discuss Answer with explanation Answer: Option A Explanation The C library function strcmp() compares two strings with each other and return the value accordingly. int strcmp(const char *str1, const char *str2) Comparison happens between first string (str1) with second string (str2). By comparing two strings, the values return by the function strcmp() are, If, str1 is less than str2 then Return value < 0 If, str2 is less than str1 then Return value > 0 If, str1 is equal to str2 then Return value = 0 Workspace
Discuss about the question