ShriRam Changed status to publish July 16, 2022
//strcmp ( ) Returns 0 if str1 is same as str2. Returns <0 if strl < str2 Returns >0 if str1 > str2. #include<stdio.h> #include<string.h> main() { char leftStr[] = "abc"; char rightStr[] = "abc"; int res = strcmp(leftStr, rightStr); if (res == 0) printf("Strings are equal"); else printf("Strings are unequal"); printf("\nValue returned by strcmp() is: %d", res); }
ShriRam Changed status to publish July 16, 2022