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
Where are the auto variables stored?
Explain the use of 'auto' keyword in c programming?
Write a program to use switch statement.
What are the types of data types and explain?
How do I use strcmp?
Explain a pre-processor and its advantages.
What is the process to generate random numbers in c programming language?
why use functions a) writing functions avoids rewriting the same code over and over b) using functions it becomes easier to write programs and keep track of what they are doing c) a & b d) none of the above
Write a program to implement a round robin scheduler and calculate the average waiting time.Arrival time, burst time, time quantum, and no. of processes should be the inputs.
What the advantages of using Unions?
What is void c?
Can stdout be forced to print somewhere other than the screen?
What are register variables in c?
What does dm mean sexually?
What is type qualifiers?