write a own function to compare two strings with out using
stringcomparition function?
Answer Posted / geetha
main()
{
char a[10],b[10];
int i,l2,l1;
printf("Enter two strings");
scanf("%s\n",a);
scanf("%s",b);
l1=strlen(a);
l2=strlen(b);
if(l1==l2)
{
for(i=0;i<l1;i++)
{
if(a[i]==b[i])
continue;
else
printf("no match");
break;
}
}
else
printf("no match");
if(i==11)
printf("both strings are same");
}
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Who is the main contributor in designing the c language after dennis ritchie?
write a program that types this pattern: 12345678987654321 12345678 87654321 1234567 7654321 123456 654321 12345 54321 1234 4321 123 321 12 21 1 1
Lists the benefits of c programming language?
What is difference between arrays and pointers?
What is 1d array in c?
What is define c?
What is the difference between fread and fwrite function?
Do pointers take up memory?
What is a null pointer assignment error? What are bus errors, memory faults, and core dumps?
Tell me with an example the self-referential structure?
What are the application of void data type in c?
What is anagram in c?
what are enumerations in C
Why do we use int main instead of void main in c?
How can I use a preprocessorif expression to ?