Comparison of Two Strings"strcmp" compares the string "s1" to the string "s2". Both strings must be terminated by the usual '\0' character.
Program:
#include<conio h>
#include<stdio h>
void main()
{
char a[100],b[100];
int x;
clrscr();
printf(“Enter
2 strings:\n”);
scanf(“%s%s”,a,b);
x=strcmp(a,b);
if(x==0)
printf(“Strings
are equal”);
else
printf(“Strings
are not equal”);
getch();
}
0 Comment "With example program written in C language describe the term Union."
Post a Comment