Compare String using STRCMP() – C Program

In previous C Language Program post we had discussed about String in Reverse Order and Toggle Case in String and Convert String to Lower Case and Convert String to Upper Case and Calculate Length of String and Reverse String.

STRCMP() Function – C Program

Write a c program to compare two string using STRCMP() function.

STRCMP() Function – The STRCMP() Function used to compare two string, either it equal or not.

The Syntax of STRCMP() Function :

strcmp(str1, str2)  == 0 – both string str1 and str2 are equal.
strcmp(str1, str2)  !=0 – both string str1 and str2 are not equal.

Example of STRCMP() Function C Program

The String Compare C Program output is :

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *

4 + 6 =


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">