Answer to Question #310824 in C++ for Diya

Question #310824

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.

1
Expert's answer
2022-03-14T08:37:27-0400
#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";
}

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