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


Please Help Members By Posting Answers For Below Questions

How can you determine the maximum value that a numeric variable can hold?

627


Do you know null pointer?

596


hi, which software companys will take,if d candidate's % is jst 55%?

1652


If I have a char * variable pointing to the name of a function ..

641


What is a structure in c language. how to initialise a structure in c?

597






write a c program to find the largest and 2nd largest numbers from the given n numbers without using arrays

1777


Describe the difference between = and == symbols in c programming?

769


diff between exptected result and requirement?

1592


differentiate built-in functions and user – defined functions.

611


Write a C++ program to generate 10 integer numbers between - 1000 and 1000, then store the summation of the odd positive numbers in variable call it sum_pos, then find the maximum digit in this variable regardless of its digits length.

1560


When was c language developed?

691


Tell me the use of bit field in c language?

620


What are control structures? What are the different types?

588


Explain two-dimensional array.

617


Why do we use int main instead of void main in c?

606