163. C Program to Compare Two Stings are Same or Not.
How does this program work?
- This Program is used to compare two srings.
Here is the code
#include <stdio.h>
#include <string.h>
int main()
{
//To compare two strings equal or not
char a[10], b[10];
puts("Enter a string\n");
gets(a);
puts("Enter another string to compare\n");
gets(b);
if (strcmp(a,b) == 0)
printf("The strings are equal.\n");
else
printf("The two strings are not equal.\n");
return 0;
}