Use app×
QUIZARD
QUIZARD
JEE MAIN 2026 Crash Course
NEET 2026 Crash Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
+1 vote
4.3k views
in Functions by (29.7k points)
closed by

Differentiate between the string functions strcmp() and strcmpi(). 

1 Answer

+3 votes
by (29.8k points)
selected by
 
Best answer

strcmp(): 

It is used to compare two strings and returns an integer. 

Syntax: strcmp(string1,string2) 

  • if it is 0 both strings are equal.
  •  if it is greater than 0(i.e. +ve) stringl is greater than string2 
  • if it is less than 0(i.e. -ve) string2 is greater than string1 

strcmpi(): It is same as strcmp() but it is not case sensitive. That means uppercase and lowercase are treated as same. 

eg: “ANDREA” and “Andrea” and “andrea” these are same.

Related questions

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

...