206k views
3 votes
Write a program named ArrayDemo that stores an array of 10 integers. (Note that the array is created for you and does not need to be changed.)

1 Answer

3 votes

Answer:

See explanation

Step-by-step explanation:

The Programming language is not stated.

However I'll answer using C++

Also, the array data is not stated, so I'll answer in two ways

1. I'll make use of any data

#include<iostream>

using namespace std;

int main(){

int arraydemo[10] = {1,2,7,8,9,10,5,4,63}

return 0;

}

2. Get user input

#include<iostream>

using namespace std;

int main ()

{

int myarray [10];

for(int I=0;I<10;I++){

cin>>myarray [I];

}

return 0;

}

The first program is self explanatory while the second used loop to iterate through the array in order to get user inputs

User Mpeterson
by
4.6k points