Computer Science, asked by TbiaSamishta, 1 year ago

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

Answers

Answered by Secondman
1

ANSWER: OPTION B


Given: 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.

Similar questions