/* This program creates a vector of size n, and compute */ /* the sum of the vector. n is inputed by the user */ #include using namespace std; int main( ) {int n, i; double *p; cout << "Please enter the size of the vector: "<> n; p = new double[n]; // dynamically allocate array cout << "Input the values for the vector with size " << n <> p[i]; } // compute the sum of the vector double sum = 0.0; for(i=0; i