Write a program to compare two strings without using the
strcmp() function
Answer Posted / anil sai krishna
#include<stdio.h>
main()
{
char a[15],b[15];
int i,l=0,m;
printf("enter the two strings");
scanf("%s%s",a,b);
for(i=0;a[i]=b[i];i++)
{
l++;
}
for(i=0;a[i]!='\0';i++)
{
m++;
}
if(l==m)
{
printf("strings are equal");
}
else
{
printf("not equal");
}
}
| Is This Answer Correct ? | 7 Yes | 5 No |
Post New Answer View All Answers
What does #pragma once mean?
Synonymous with pointer array a) character array b) ragged array c) multiple array d) none
write a c programming using command line argument,demonstrate set operation(eg;union,intersection,difference) example output is c:>setop 12 34 45 1 union 34 42 66 c:>setop 12 34 1 42 66 c:>setop 12 34 diff 12 56 67 78 setop 12 34
How can my program discover the complete pathname to the executable from which it was invoked?
What is wild pointer in c?
Write a program to generate the Fibinocci Series
How to write a code for implementing my own printf() and
scanf().... Please hep me in this... I need a guidance...
Can you give an coding for c... Please also explain about
the header files used other than #include
What are the properties of union in c?
How do you define a function?
What is a function in c?
How can I manipulate individual bits?
What is #include called?
Explain which function in c can be used to append a string to another string?
What is an operator?
What library is sizeof in c?