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
Can a program have two main functions?
Is fortran still used in 2018?
What is the explanation for cyclic nature of data types in c?
How does free() know explain how much memory to release?
What are terms in math?
I have written a pro*C program to fetch data from the cursor. where in i have used the concept of BULK FETCH.... each FETCH statement is taking lots of time to fetch specified number of rows at...
Given a valid 24 hour format time find the combination of the value and write a program ,do not hard the value and if any other inputs provided should work with the logic implemented Input: 11:30 Output: 13:10 Input: 18:25 Output: 21:58
What are the disadvantages of external storage class?
What are register variables? What are the advantage of using register variables?
c language interview questions & answer
What is the use of ?
Difference between Function to pointer and pointer to function
Define Spanning-Tree Protocol (STP)
What are the primitive data types in c?
Is there any algorithm to search a string in link list in the minimum time?(please do not suggest the usual method of traversing the link list)