1.

Which of the following is correct, If we write strcmp(s1,32), returns a value? a) 0 when s1 > s2 d) all of these

Answer»

OPTION BGiven: strcmp (s1 ,32)Let us take s1 as string 1 and 32 as string 2. The ASCII value of first character each string should be COMPARED. ASCII value of  s: 19 ASCII value of 3: 51. Hence, the string 2 ASCII value is higher than the first character of string 1 ASCII value. strcmp RETURNS the value less than ZERO since s1 < S2.



Discussion

No Comment Found