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


Please Help Members By Posting Answers For Below Questions

What is the collection of communication lines and routers called?

614


How to delete a node from linked list w/o using collectons?

2090


Compare array data type to pointer data type

601


Write a program to print factorial of given number without using recursion?

570


what is reason of your company position's in india no. 1.

1778






How can I read in an object file and jump to locations in it?

582


What is meant by operator precedence?

679


Which is an example of a structural homology?

786


Why use int main instead of void main?

600


List some of the static data structures in C?

763


What does int main () mean?

553


write a C program: To search a file any word which starts with ?a?. If the word following this ?a? starts with a vowel.Then replace this ?a? with ?a? with ?an?. redirect with the output onto an output file.The source file and destination file are specified by the user int the command line.

2456


Explain enumerated types in c language?

606


What is variable declaration and definition in c?

504


What is wild pointer in c?

610