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
What are the keywords in c?
What are types of functions?
Why isn't it being handled properly?
Where can I get an ansi-compatible lint?
Why is this loop always executing once?
what is diffrence between linear and binary search in array respect to operators?what kind of operator can be used in both seach methods?
Can you please explain the scope of static variables?
Is main is a keyword in c?
What is meant by inheritance?
What is volatile keyword in c?
What is the difference between pure virtual function and virtual function?
How would you obtain the current time and difference between two times?
What are the c keywords?
What are two dimensional arrays alternatively called as?
What are the disadvantages of external storage class?