94. Program to compare two strings.
#include
#include
void main()
{
char a[100], b[100];
clrscr();
printf("\nEnter the first string : ");
gets(a);
printf("\nEnter the second string : ");
gets(b);
if (strcmp(a, b) == 0)
printf("\nEntered strings are equal.");
else
printf("\nEntered strings are not equal.");
getch();
}
#include
#include
void main()
{
char a[100], b[100];
clrscr();
printf("\nEnter the first string : ");
gets(a);
printf("\nEnter the second string : ");
gets(b);
if (strcmp(a, b) == 0)
printf("\nEntered strings are equal.");
else
printf("\nEntered strings are not equal.");
getch();
}