60 475
Assignments Done
98,1%
Successfully Done
In April 2018

Answer to Question #37365 in C++ for Mike Witter

Question #37365
Write code that dynamically allocates an array of 20 integers, then uses a loop to allow the user to enter values for each element of the array
Expert's answer
#include <iostream> 
#include <conio.h>

using namespace std;

int main ()
{
int* array = new int [20];
for (int i=0; i<20; i++)
{
cout<<"Enter the "<<i+1<<" elemet of the array: ";
cin>>array[i];
}
cout<<"So, this is the array :"<<endl;
for (int i=0; i<20; i++)
{
cout<<array[i]<<" ";
}
delete [] array;
_getch();
return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions