c program to compare 2 strings using user defined function

#include <stdio.h>

int compareStrings(char str1[], char str2[]);

int main() {
    char str1[100], str2[100];

    printf("Enter the first string: ");
    scanf("%s", str1);

    printf("Enter the second string: ");
    scanf("%s", str2);

    if (compareStrings(str1, str2) == 0)
        printf("The strings are equal.\n");
    else
        printf("The strings are not equal.\n");

    return 0;
}

int compareStrings(char str1[], char str2[]) {
    int i = 0;

    while (str1[i] != '\0' && str2[i] != '\0') {
        if (str1[i] != str2[i])
            return 1;
        i++;
    }

    if (str1[i] == '\0' && str2[i] == '\0')
        return 0;
    else
        return 1;
}