![]() |
VOOZH | about |
Given two strings, check if these two strings are identical(same) or not. Consider case sensitivity.
Examples:
Input: s1 = "abc", s2 = "abc"
Output: YesInput: s1 = "", s2 = ""
Output: YesInput: s1 = "GeeksforGeeks", s2 = "Geeks"
Output: No
Table of Content
The idea is to use equality operator (==) to compare both strings character by character. If the strings are identical, it prints "Yes", otherwise, it prints "No".
No
The idea is to the direct string comparison function, which compares the strings character by character. If the strings are exactly the same, it returns 0.. If the strings are different,, returns a non-zero value. Based on this result, the program prints "Yes" if the strings match and "No" if they don't. The comparison stops as soon as a mismatch is found or the strings end.
Yes
Yes