Answer to Question #20180 in C++ for apoorva

Question #20180
Write a program to compare two strings for equality.
1
Expert's answer
2012-12-06T12:10:36-0500
#include <iostream>
#include <string>
using namespace std;
int main(){

string a,b;
cout<<"Enter two strings\n";
cin>>a>>b;
if (a == b) cout<<"A and B are equal\n";
else cout<<"A and B aren't equal\n";

system("pause");
return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS