Question: #include using namespace std; bool equals(int a[], int a_size, int b[], int b_size) { if (a_size == b_size) { for (int i = 0; i

#include using namespace std; bool equals(int a[], int a_size, int b[], int b_size) { if (a_size == b_size) { for (int i = 0; i < a_size; i++) { if (a[i] != b[i]) { return false; } } return true; } else { return false; } } int main() { char repeat; float avalue, bvalue; int a_value[20], b_value[20]; int a_size = 0; int b_size = 0; do { cout << "Enter the first array value (Q/q to stop) = "; while (cin >> avalue) { a_value[a_size] = avalue; a_size++; } cout << "Enter the second array value (Q/q to stop) = "; while (cin >> bvalue) { b_value[b_size] = bvalue; b_size++; } cout << "Array A = { "; for (int i = 0; i < a_size; i++) { cout << a_value[i] << " "; } cout << "}." << endl; cout << "Array B = { "; for (int i = 0; i < b_size; i++) { cout << b_value[i] << " "; } cout << "}." << endl; cout << "Size of array A = " << a_size << endl; cout << "Size of array B = " << b_size << endl; if (equals(a_value, a_size, b_value, b_size)) { cout << "Both arrays are the same. " << endl; } else { cout << "Two arrays are difference. " << endl; } cout << "Do you want continue (y/n): "; cin >> repeat; } while (repeat == 'y'); cout << "Exit!" << endl; system("Pause"); return 0; } student submitted image, transcription available below

can't input second array

Enter the first array value (Q/q to stop) =1234 Enter the second array value (Q/q to stop) = Array A={1234} Array B={}. Size of array A=4 Size of array B=0 Two arrays are difference. Do you want continue (y/n): Exit! Press any key to continue

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!