if (result = = 0)
printf(“\nEntered strings are equal.\n”);
else
printf(“\nEntered strings are not equal.\n”);
}
int compare(char a[ ] , char b[ ] )
{
int c = 0;
while (a[c] = = b[c])
{
if (a[c] = = ‘\0’ || b[c] = = ‘\0’)
break;
c++;
}
if (a[c] = = ‘\0’ && b[c] = = ‘\0’)
return 0;
else
return -1;
}
Do'stlaringiz bilan baham: