#include<conio.h>
#include < stdio.h >
#include < string.h >
#include < string.h >
int main()
{
char a[100], b[100];
{
char a[100], b[100];
printf("Enter the first string\n");
gets(a);
gets(a);
printf("Enter the second string\n");
gets(b);
gets(b);
//strcmp(string, string) : returns 0 if strings are equal else strings are unequal
if( strcmp(a,b) == 0 )
printf("Entered strings are equal.\n");
else
printf("Entered strings are not equal.\n");
if( strcmp(a,b) == 0 )
printf("Entered strings are equal.\n");
else
printf("Entered strings are not equal.\n");
getch();
}
No comments:
Post a Comment