Write a program to compare two strings without using the
strcmp() function
Answer Posted / belsia
void main()
{
char a[10],b[10];
int i=0;
scanf("%s%s",a,b);
if(strlen(a)!=strlen(b))
printf("they are different strings");
else
{
while(a[i]!='\0')
{
if(a[i]==b[i])
i++;
else
{
printf("They are different strings");
exit(0);
}
printf("Both are same");
}
getch();
}
| Is This Answer Correct ? | 27 Yes | 16 No |
Post New Answer View All Answers
How does selection sort work in c?
Where are some collections of useful code fragments and examples?
How arrays can be passed to a user defined function
How to establish connection with oracle database software from c language?
What is output redirection?
What are the output(s) for the following ? #include char *f() {char *s=malloc(8); strcpy(s,"goodbye")} main() { char *f(); printf("%c",*f()='A'); }
What is actual argument?
Difference between macros and inline functions? Can a function be forced as inline?
in linking some of os executables are linking name some of them
Do you know what are the properties of union in c?
What is double pointer?
how to introdu5ce my self in serco
What is volatile keyword in c?
Why is extern used in c?
Explain high-order and low-order bytes.