Home Work 02
Dynamic Memory Allocation, Array Task 1: Declare two integer arrays, A and B, of size 5. Take user input for both arrays and determine whether the two arrays are identical or not. Two arrays are identical if both contain same values at same indices. Print “Identical” or “Not identical” based on your finding. #include <iostream> using namespace std; int main() { // decleartion int *a, *b; a = new int[5]; b = new int[5]; // user input cout << "Enter A array: " << endl; for (int i = 0; i < 5; i++) { cin >> a[i]; } // user input cout << "\nEnter B array: " << endl; for (int i = 0; i < 5; i++) { cin >> b[i]; } int f = 0; // to idetify a & b array for (int i = 0; i < 5; i++) { if (a[i] != b[i]) { f = 1; break; } } if (f == 0) { cout << "\nIdentica...