/* checking whether <= etc can be used on strings to test * lexicographic order. In the examples I have seen, * C has been assigning variables to memory addresses in * decreasing order. Hence inputting a lexico.-smaller * string first followed by a higher one will give the * desired contradiction (assuming your compiler/run does * the same). */ #include #include int main(void) { char sone[12], stwo[12]; printf("Input 1 please: "); scanf("%s", sone); printf("/nInput 2 please: "); scanf("%s", stwo); if (sone <= stwo) printf("%s is less than %s.\n", sone, stwo); else printf("%s is less than %s.\n", stwo, sone); return EXIT_SUCCESS; }