write a own function to compare two strings with out using
stringcomparition function?
Answer Posted / sasikumar
main()
{
char s1[10],s2[10];
printf("enter two strings:");
scanf("%s%s",&s1[10],&s2[10]);
compare(s1[10],s2[10]);
getch();
}
compare(char st1[10],char st2[10])
{
int l1,l2,i;
l1=strlen(st1[10]);
l2=strlen(str2[10]);
if(l1==l2)
{
for(i=0;i<l1;i++)
{
if(st1[i]==st2[i])
{
if(i==l1)
{
printf("two strings are equal");
}
}
else
goto label:
}
}
else
goto label:
label:printf("not equal");
}
Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
find the value of y y = 1.5x+3 for x<=2 y = 2x+5 for x>2
How do we print only part of a string in c?
What is the use of ?
How can you increase the allowable number of simultaneously open files?
‘SAVEPOINT’ and ‘ROLLBACK’ is used in oracle database to secure the data comment. Give suitable examples of each with sql command.
What is multidimensional arrays
Define recursion in c.
What is the difference between the local variable and global variable in c?
Tell me what is the purpose of 'register' keyword in c language?
What are the types of data files?
What are terms in math?
define string ?
Why is void main used?
What is the difference between union and anonymous union?
What is pre-emptive data structure and explain it with example?