Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Correct way to find if contents of two strings are equal?

a) if (s1 = s2)
b) if (s1 != s2)
c) if (strcmp (s1 ,s2))
d) if ( s1 is s2)

Answer: c
Explanation: “==” operator used to compare length of two strings and strcmp() is the inbuilt method derived from string class.

Join The Discussion