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, value; int a_value[20], b_value[20]; int a_size = 0; int b_size = 0; do { cout << "Enter the first array value (s to stop) = "; while (true) { cin >> value; if (value != 's') { a_value[a_size] = value; a_size++; } else { break; } } cout << "Enter the second array value (s to stop) = "; while (true) { cin >> value; if (value != 's') { b_value[b_size] = value; b_size++; } else { break; } } 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

How to print Array A = { 1 2 3 4 }

Enter the first array value (s to stop) =1234s Enter the second array value (s to stop) =1234s Array A={495052}. Array B={49505152} Size of array A=4 Size of array B=4 Both arrays are the same. Do you want continue (y/n)

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!