Table of Contents
show
Use of strcmpi( ) function
#include<stdio.h>
#include<string.h>
int main()
{
char s1[20], s2[20];
int res;
puts("Enter string 1:");
gets(s1);
puts("Enter string 2:");
gets(s2);
res = strcmpi(s1,s2);
if(res == 0)
{
printf("strings are equal\n");
}
else
{
printf("strings are unequal\n");
}
}
Output
Enter string 1:
hello
Enter string 2:
Hello
strings are equal
Views: 0