We want a function that takes as parameters two strings and return 1 if they are the same or 0 if they are not the same.

1
2
3
4
5
6
7
8
9
int compare(char *word1,char *word2){
    while(*word1 && *word2)
        if(*word1++ != *word2++)
            return 0;
    if(*word1==*word2)
        return 1;
    else
        return 0;
}