Strings

Q1: Which of the following statement is correct?

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<s2

C strcmp(s1, s2) returns 0 if s1==s2

D strcmp(s1, s2) returns 1 if s1==s2

ANS:C - strcmp(s1, s2) returns 0 if s1==s2

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.



img not found
img

For help Students Orientation
Mcqs Questions

One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.