Write a program to compare two strings without using the
strcmp() function
Answer Posted / akash aggarwal
Guys What the hell????
strcmp tells you whether strings are equal or not, if not which is greater then other.....
So first compare their length...
example let
str1="abc";
str2="abcde";
now compare their lengths, if len1 >len2 means str1 is greater else
if len2>len1 then str2 is greater
else the above compare is required...........
| Is This Answer Correct ? | 4 Yes | 12 No |
Post New Answer View All Answers
What is a rvalue?
PROGRAM TO WRITE CONTENTS OF 1 FILE IN REVERSE TO ANOTHER FILE,PROGRAM TO COPY 1 FILE TO ANOTHER BY SPECIFYING FILE NAMES AS COMMAND LINE
Why do we use & in c?
What is maximum size of array in c?
Is null valid for pointers to functions?
How do you determine the length of a string value that was stored in a variable?
What are the different types of C instructions?
What is const volatile variable in c?
Compare array data type to pointer data type
What is meant by 'bit masking'?
What are categories used for in c?
what is diffrence between linear and binary search in array respect to operators?what kind of operator can be used in both seach methods?
what is the basis for selection of arrays or pointers as data structure in a program
Why main is used in c?
Explain what is operator promotion?