Write a function makeDoubles in c++, that takes an integer parameter called size and:
#include <iostream> using namespace std; double *makeDoubles(int size); int main() { int size; cout << "Enter size: "; cin >> size; double *arr = makeDoubles(size); for (int i = 0; i < size; ++i) { cout << arr[i] << " "; } cout << endl; delete[] arr; return 0; } double *makeDoubles(int size) { double *arr = new double[size]; for (int i = 0; i < size; ++i) { arr[i] = 0; } return arr; }
Get Answers For Free
Most questions answered within 1 hours.