pllllllllllzzzzz someone help me out for this plzzzzz...i want to output equal words from words groups n1 and n1. this program just giving value of the equal words.not the words.plzzz help meeeeeee
// my.lab.5.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <cstring>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
char words1[15][20];
char words2[15][20];
int n1;
int n2;
int r1;
cout<< "how many words you wish to enter:";
cin>> n1;
cout<< "please enter 1st line:";
for(int i=0; i<n1; i++)
{
cin>> words1[i];
}
cout<< "how many words you wish to enter:";
cin>> n2;
cout<< "please enter 2nd line:";
for(int j=0; j<n2; j++)
{
cin>> words2[j];
}
r1=0;
for(int m=0; m<n1; m++)
{
//calculate and repeat, word1[m] in word2[]
for( int k=0; k<n2; k++)
{
if(!strcmp(words1[m],words2[k]))
{
r1++;
}
}
}
cout<< "number of equal words:" << r1 ;