Write a C program named mystrcmp that will run the following prototype appropriately. Although the mystrcmp function has the same function as the strcmp function, the only difference is that it is not key sensitive. int mystrcmp(const char *s1,const char *s2); EXAMPLE OUTPUT 1: Enter 1st sentence: I am not in danger, Skyler. I am the danger. Enter 2nd sentence: I am not in danger, SKYLER. I am the danger. mystrcmp function returns 0 EXAMPLE OUTPUT 2: Enter 1st sentence: Luke, i am your father. Enter 2nd sentence: Luke, you are my son. mystrcmp function returns -1
#include <stdio.h> #include <string.h> #include <ctype.h> int mystrcmp(const char *s1,const char *s2); int main() { char s1[100], s2[100]; int result; printf("Enter 1st sentence: "); gets(s1); printf("Enter 2nd sentence: "); gets(s2); result = mystrcmp(s1,s2); printf("mystrcmp function returns %d\n", result); return 0; } int mystrcmp(const char *s1,const char *s2) { char string1[100], string2[100]; int i; for(i = 0; s1[i] != '\0'; i++) string1[i] = tolower(s1[i]); for(i = 0; s2[i] != '\0'; i++) string2[i] = tolower(s2[