English
Tamil Nadu Board of Secondary EducationHSC Science Class 11

Write about strcmp() function. - Computer Science

Advertisements
Advertisements

Question

Write about strcmp() function.

Short/Brief Note
Advertisements

Solution

The strcmp() function takes two arguments: string1 and string2. It compares the contents of string1 and string2 lexicographically.

The strcmp() function returns a:

  1. A positive value if the first differing character in string1 is greater than the corresponding character in string2. (ASCII values are compared)
  2. Negative value if the first differing character in string1 is less than the corresponding character in string2.
  3. 0 if string1 and string2 are equal.
shaalaa.com
  Is there an error in this question or solution?
Chapter 11: Functions - Evaluation - Section - C [Page 205]

APPEARS IN

Samacheer Kalvi Computer Science [English] Class 11 TN Board
Chapter 11 Functions
Evaluation - Section - C | Q 3. | Page 205
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×