The memcmp() function compares the first n bytes of memory area str1 and memory area str2.
char str1 ="ABCD";
char str2 ="abcd";
int res =memcmp(str1, str2, 3);
printf("str1 is equal to str2");
else if(res >0)
printf("str1 is greater than str1");
elseprintf("str1 is less than str2");