Look out the following program, here I am returning the value depending upon the string you have typed. The function strcmp
retrun value according to ASCII value of whole string considered totally.
For eg. str1 = "aab"
and str2 = "aaa"
will return 1 as aab > aaa.
int main()
{
char str1[15], str2[15];
int n;
printf("Enter the str1 string: ");
gets(str1);
printf("Enter the str2 string : ");
gets(str2);
n = strcmp(str1, str2);
printf("Value returned = %d\n", n);
return 0;
}