include iostream include string using namespace std int main char str

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <iostream>
#include <string.h>
using namespace std;
int main() {
char str[100], str2[100];
cout << "Input first string : ";
cin >> str;
cout << "Input second string : ";
cin >> str2;
if (strcmp(str, str2) == 0) {
cout << "Strings are equivalent.";
}
else {
cout << "Strings are not equivalent.";
}
return 0;
}