Sam wants to create a program that required 20 integers. Suppose the following numbers are the value input as A [10] = {-10, 20, 30, 40, – 50, -60, -70, 30, 90, 10} and B[10] = {15, 12, 13,14, – 50, -60, -20, 25, 35, 30}.
1
Expert's answer
2020-09-28T10:56:38-0400
#include<iostream>usingnamespace std;
intmain(){
constint size = 10;
int A[size], B[size];
cout << "Enter ten numbers in the array A: ";
for (int i = 0; i < size; i++)
cin >> A[i];
cout << "Enter ten numbers in the array B: ";
for (int i = 0; i < size; i++)
cin >> B[i];
cout << "\n\n";
cout << "Array A:";
for (int i = 0; i < size; i++)
cout << ' ' << A[i];
cout << '\n';
cout << "Array B:";
for (int i = 0; i < 10; i++)
cout << ' ' << B[i];
cout << "\n\n";
return0;
}
Comments