#include <stdio.h>
#define LenLine 81
// read two strings and compare them
int compStr(char[],char[]) ;
void main()
{
char str1[LenLine] , str2[LenLine];
int result ;
printf(" insert first string(80 char max): ");
gets(str1) ;
printf("\n insert second string(80 char max): ");
gets(str2) ;
result = compStr(str1,str2);
if (!result)
printf("\n The two string are equal \n");
else
printf("\n The two string are diffrent. the diffrent between the two
first char is: %d \n\n",result);
}
int compStr(char str1[],char str2[])
{
int i;
for (i=0 ; str1[i]==str2[i] ; i++)
if (!str1[i]) return 0;
return str1[i]-str2[i];
}