Write a program to compare two strings without using the
strcmp() function
Answer Posted / raghu ram. n
#include<stdio.h>
void main()
{ char string1[50], string2[50];
int i=0;
printf("Enter First String :");
gets(string1);
printf("Enter Second String :");
gets(string2);
while(string1[i]!=0&&string2[i]!=0&&srting1[i]==string2[i])
i++;
if(string1[i]=='\0'&&string2[i]=='\0')
printf("Two strings are equal");
else
printf("Two string are not equal");
}
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Explain how can I prevent another program from modifying part of a file that I am modifying?
What is the condition that is applied with ?: Operator?
How pointer is different from array?
What is the use of getch ()?
How to implement a packet in C
What is difference between union All statement and Union?
Can a pointer be volatile in c?
What is difference between %d and %i in c?
What do header files do?
What is a macro?
What is an identifier?
write a program for the normal snake games find in most of the mobiles.
please explain every phase in the "SDLC" in the dotnet.
What is the difference between char array and char pointer?
which of the following statement is wrong a) mes=123.56; b) con='T'*'A'; c) this='T'*20; d) 3+a=b;