~cpp #include<iostream> using namespace std; void main() { int i; int *a = new int[4]; int *b = new int[4]; int *c = new int[4]; for(i=0; i<=3; i++){ a[i] = b[i] = i; c[i] = a[i] + b[i]; cout << c[i]; } delete [] a; delete [] b; delete [] c; }
~cpp #include<iostream> using namespace std; void main() { int i; int *a = new int[4]; int *b = new int[4]; int *c = new int[4]; for(i=0; i<=3; i++){ a[i] = b[i] = i; c[i] = a[i] + b[i]; cout << c[i]; } delete [] a; delete [] b; delete [] c; }