6. Write a C++ program that take two string as input from user and check if both strings are same or not. If same, print YES, otherwise print NO.
#include <iostream>
#include <string>
using namespace std;
int main()
{
string s1, s2;
getline(cin, s1);
getline(cin, s2);
if (s1==s2) cout<<"YES";
else cout<<"NO";
}
Comments
Leave a comment