Code:
#include iostream
#include string
using namespace std;
int main()
{
int *array, size;
cout<<"Enter size of array: ";
cin>>size;
array = new int [size];
for (int i = 0; i < size; i++)
{
cout<<"Enter an integer to be inserted: ";
cin>>array[i];
}
for(int i = 0; i < size; i++)
{
cout<
}
cout<
delete []array;
return 0;
}
Output:
Enter size of array: 5
Enter an integer to be inserted: 3
Enter an integer to be inserted: 4
Enter an integer to be inserted: 2
Enter an integer to be inserted: 5
Enter an integer to be inserted: 1
3 4 2 5 1
------------------
(program exited with code: 1)
Press return to continue
More C++ Programs: