hi
everybody I hope you are fine
I am trying to change a little bit in the format of the strcmp function ;;;
what I need from the program is to compare two lower case and upper case strings and tell that they are the same
I have a try on that but the problem is if I type two different strings it also give me that they are equivalent
this is my code and thanks for your time
Code:#include <string.h> #include <stdio.h> int strcmp1 (char s1[], char s2[]); main() { char s1[81], s2[81]; gets(s1); gets(s2); if (strcmp1(s1, s2)) printf("The strings are equal\n"); else printf("sorry"); return 0; } int strcmp1 (char s1[], char s2[]) { int i; for (i=0; s1[i]!='\0'||s2[i]!='\0'; i++ ) { if(s1[i]!=s2[i]) return s1[i]-s2[i]; } return s1[i]-s2[i]; }