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
Explain the difference between strcpy() and memcpy() function?
find out largest elemant of diagonalmatrix
Write a program to find factorial of a number using recursive function.
Apart from dennis ritchie who the other person who contributed in design of c language.
What are integer variable, floating-point variable and character variable?
what are the 10 different models of writing an addition program in C language?
How can I implement a delay, or time a users response, with sub-second resolution?
Is c pass by value or reference?
Are the outer parentheses in return statements really optional?
Should a function contain a return statement if it does not return a value?
What is page thrashing?
What is hashing in c?
c program for searching a student details among 10 student details
What is atoi and atof in c?
Describe static function with its usage?