xxxxxxxxxx
// Function to compare two strings
function compareStrings(str1, str2) {
if (str1 === str2) {
return "The strings are equal.";
} else {
return "The strings are not equal.";
}
}
// Example usage
const string1 = "Hello";
const string2 = "hello";
const result = compareStrings(string1, string2);
console.log(result);
xxxxxxxxxx
string1 = input("Enter the first string: ")
string2 = input("Enter the second string: ")
if string1 == string2:
print("The strings are equal.")
else:
print("The strings are not equal.")