Test two arrays to determine if they contain the same value in the same position.
Write a main program that test function isEqual.
Prototype: bool isEqual(int A[], int B[]);
Write a main program that test function isEqual.
Prototype: bool isEqual(int A[], int B[]);
Code:
#include <iostream>
#include <cmath>
using namespace std;
// Function prototypes
bool isEqual(int list[], int list2[]);
int main()
{
// Local Identifiers
int list[100];
int list2[100];
int a, b, i, j;
// Ouputs if arrays are the same of not.
cout << endl << "Please input a sequence of numbers: " << endl;
cin >> list[a];
cout << endl << "Please input a second sequence of numbers: " << endl;
cin >> list2[b];
{
for (i = 0; i < 100; i++)
{
for (int j = 0; j< 100; ++j)
{
if (list[i] == list2[j])
{
return true;
}
else
return false;
}
system("pause");
return 0;
} // Functions to compare arrays.
bool isEqual(int a[], int b[])
{
if (a[] == b[])
{
return true;
}
else return false;
}
Comment