Strings - Point Out Correct Statements :: Discussion


3.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
C.strcmp(s1, s2) returns 0 if s1==s2
D.strcmp(s1, s2) returns 1 if s1==s2
Answer:  Option  C
Explanation:

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.

Tutorial Link:
Published by:Michael Daani

Comments are not available

Post your comments here:

Optional

Date to Date Current Affairs 2022

PakMCQs.net

Quick Links

GAT Subject



   Computer Science    English Mcqs    Agriculture    

Engineering



   Computer Science    Civil Engineering    

Technical



   Networking    Electronics    Database    

Past Papers



   Model Papers    FPSC Papers