Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  2.1
Language: C/C++
Code:
#include <iostream>
#include<cstring>
using namespace std;

int main() {
  char str1[100];
  char str2[100];
  cout<<"Enter 1st string(str1): ";
  cin>>str1;
  cout<<"Enter 2nd string(str2):  ";
  cin>>str2;

  int result = strcmp(str1, str2);
    if (result == 0){
        cout<<"EQUAL!";
    
    
    }else{
        cout<<"unequal";

        return 0;
    }
}
          
Comments: