Multiple choice

Which of the following library functions is used to compare two strings and give appropriate results?

  1. strcat()

  2. tolower()

  3. strcmp()

  4. none of these

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

This function compares two strings and returns less than zero value if the first string is less than the second string; returns zero if both the strings are equal; and more than zero value if the first string is greater than the second string.