Q4. Accept any two strings from the user. Display whether both the strings are equal or not. (do not use standard functions.)
Answers
Answered by
0
Programmed in C++
#include <iostream>
using namespace std;
int main(){
string first,second;
cout << "Enter a string" << endl;
cin >> first;
cout << "Enter another string" << endl;
cin >> second;
if(first == second){
cout << "Strings are equal" << endl;
} else {
cout << "Strings are not equal" << endl;
}
return 0;
}
#include <iostream>
using namespace std;
int main(){
string first,second;
cout << "Enter a string" << endl;
cin >> first;
cout << "Enter another string" << endl;
cin >> second;
if(first == second){
cout << "Strings are equal" << endl;
} else {
cout << "Strings are not equal" << endl;
}
return 0;
}
Similar questions
Math,
7 months ago
English,
7 months ago
Accountancy,
1 year ago
Biology,
1 year ago
Biology,
1 year ago
Business Studies,
1 year ago