#include <stdio.h>
#include<string.h>
int main() {
    char str1[20],str2[20];
    int i;
    printf("enter the string1:\n");
    scanf("%s",str1);
    printf("enter the string2:\n");
    scanf("%s",str2);
    while(str1[i]!='\0'&& str1[i]==str2[i])
    i++;
    if(str1[i]==str2[i])
    printf("entered string are equal\n");
    else if(str1[i]>str2[i])
    printf("string1 is greater than string2\n");
    else
    printf("string2 is greater than string1\n");
    return 0;
}

Embed on website

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