#include<stdio.h>
#include<string.h>intmain(){chara[20],b[20];printf("———————————————————————————————————————————");printf("\nProgram to compare two strings");printf("\n———————————————————————————————————————————");printf("\nEnter the 1st string ");scanf("%s",a);printf("\nEnter the 2nd string ");scanf("%s",b);intc=strcmp(a,b);if(c==0){printf("\nStrings are equal");}else{printf("\nStrings are unequal");}printf("\n———————————————————————————————————————————\n");return0;}
Output
kodingwindow@kw:~$ gcc kw.c kodingwindow@kw:~$ ./a.out
———————————————————————————————————————————
Program to compare two strings
———————————————————————————————————————————
Enter the 1st string HELLO
Enter the 2nd string WORLD
Strings are unequal
———————————————————————————————————————————
kodingwindow@kw:~$ ./a.out
———————————————————————————————————————————
Program to compare two strings
———————————————————————————————————————————
Enter the 1st string WORLD
Enter the 2nd string WORLD
Strings are equal
———————————————————————————————————————————
kodingwindow@kw:~$
Dear User, Thank you for visitng Kodingwindow. If you are interested in technical articles, latest technologies, and our journey further, please follow us on LinkedIn.
Dear User, We are grateful for your interest in the Kodingwindow Android app. We intend to soon make it available on the Google Play Store. Currently, Android versions 10 and up require manual apk installations. Would you like to get the app?