Sail E0 Webinar
Question

Which of the following statement is correct?


Options:
A .  strcmp(s1, s2) returns a number less than 0 if s1>s2
B .  strcmp(s1, s2) returns a number greater than 0 if s1
C .  strcmp(s1, s2) returns 0 if s1==s2
D .  strcmp(s1, s2) returns 1 if s1==s2
Answer: Option C

The strcmp return an int value that is

if s1 < s2 returns a value < 0

if s1 == s2 returns 0

if s1 > s2 returns a value > 0

From the above statements, that the third statement is only correct.



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers