Logo 
Search:

C++ Programming FAQ

Submit Interview FAQ
Home » Interview FAQ » C++ ProgrammingRSS Feeds

Which statement is true about compare( ) function? - Select option

  Shared By: Audris Schmidt    Date: Oct 25    Category: C++ Programming    Views: 875

Answer:

Consider the following statement:
s1.compare (s2);
Which of the following statement is true about compare( ) function?
I. Returns 0 if s1 and s2 are equal
II. Returns -1 if s1 is greater
III. Returns -1 if s2 is greater
IV. Returns 1 if s1 and s2 are equal

Options

a) Both I and III
b) Both III and IV
c) Both I and II
d) I only

Answer : a) Both I and III

Share: 
 



Your Comment
  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].


Tagged: