Can anyone help me find out whats wrong with this? It builds successfully but when you try to use it does something unusual.
Write a program that uses function strcmp to compare two strings input by the user. The program should state whether the first string is less than, equal to or greater than the second string.
Code:#include<stdio.h> #include<string.h> #include<ctype.h> int main() { char s1[100]; char s2[100]; printf("Input first string:"); gets(s1); printf("Input second string:"); gets(s2); while(s1 != NULL){ strcmp(s1,s2); if(strcmp == 0) printf("These strings are equal"); if(strcmp > 0) printf("The first string is larger"); if(strcmp < 0) printf("The second string is larger"); } s1 == "\0"; s2 == "\0"; return 0; }