1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
#include <iostream>
using namespace std;
int main()
{
int a;
int array1[10] = {1,2,3,4,5,6,7,8,9,10};
int array2[10] = {0,0,0,0,0,0,0,0,0,0};
cout << "\n\n";
cout << "array1: ";
for(a=0;a<=9;a++) cout << array1[a] << " ";
cout << "\n\n";
cout << "array2: ";
for(a=0;a<=9;a++) cout << array2[a] << " ";
cout << "\n\n";
for(a=0;a<=9;a++) array2[a] = array1[a];// copying contents of array1 to array2
cout << "array1: ";
for(a=0;a<=9;a++) cout << array1[a] << " ";
cout << "\n\n";
cout << "array2: ";
for(a=0;a<=9;a++) cout << array2[a] << " ";
return 0;
}
|