#include <string.h>
#include <stdio.h>


int main() {

    char str1[] = "hello";

    char str2[] = "helloa";

    char str3[] = "goodbye";

    char str4[] = "z";
    
    char str5[] = "a";

    char str6[] = "b";

    char str7[] = "A";

    char str8[] = "0";

    char str9[] = "1";

    char str10[] = "g";

    char str11[] = "gi";


    printf("strcmp(str1, str2) hello and helloa = %d\n", strcmp(str1, str2));  // Output: 0

    printf("strcmp(str1, str3) hello and goodbye = %d\n", strcmp(str1, str3));  // Output: negative value

    printf("strcmp(str3, str1) goodbye and hello = %d\n", strcmp(str3, str1));  // Output: positive value

    printf("strcmp(str1, str4) hello and z = %d\n", strcmp(str1, str4));

    printf("strcmp(str4, str5) z and a = %d\n", strcmp(str4, str5));

    printf("strcmp(str5, str6) a and b = %d\n", strcmp(str5, str6));

    printf("strcmp(str5, str7) a and A = %d\n", strcmp(str5, str6));

    printf("strcmp(str10, str11) g and gi = %d\n", strcmp(str10, str11));

    


    return 0;

}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: