I have to use part (a) a function named isFound that takes three arguments, namely an array of integers, its size and an integer value m; and then returns true if m is found in the array and returns false otherwise.
bool isFound (int arr[], int size, int m)
{
bool result = false;
for (int i = 0; i < size; i++){
if (m = arr[i]){
return true;
}
}
return result;
}
bool isContained(int A1[],int A2[],int size1, int size2)
{
for ( int i = 0; i < size1 ; i ++){
bool result = false;
for ( int j = 0; j < size2 && !isFound; j++){
if ( A1[i] == A2[j]){
result = true;
}
}
if (!isFound){
return false;
}
}
return true;
}