1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
zmey [24]
3 years ago
14

Write a program called array1.cpp file that use either regular for loop or range based for loop to display the contents of the a

rray test []. You can also write a function to display the contents of array. Submit your code array1.cpp to Blackboard.
Computers and Technology
1 answer:
ch4aika [34]3 years ago
7 0

Answer:

The program in C++ is as follows:

#include <iostream>

using namespace std;

void display(int array_test [], int n){

   for(int i = 0; i<n;i++){

       cout<<array_test[i]<<" ";   }

}

int main(){

   int n;

   cin>>n;

   int array_test[n];

   for(int i = 0; i<n;i++){

       cin>>array_test[i];

   }

   display(array_test,n);

   return 0;

}

Explanation:

This defines the display function

void display(int array_test [], int n){

This iterates through the array

   for(int i = 0; i<n;i++){

This prints each element of the array

       cout<<array_test[i]<<" ";   }

}

The main begins here

int main(){

This declares n as integer; n represents the length of the array

   int n;

This gets input for n

   cin>>n;

This declares the array

   int array_test[n];

The following iteration gets input for the array

   for(int i = 0; i<n;i++){

       cin>>array_test[i];

   }

This calls the display function to display the elements of the array

   display(array_test,n);

   return 0;

}

You might be interested in
What is computer system​
Yuki888 [10]

Answer:

Each type of computer may have a different shape or structure. In general, an electronic computer is an automatic information processing system consisting of two main parts: hardware and software.

Hardware can be understood simply as all electrical and electronic components and components in a computer system.

Software can be viewed as a set of programs consisting of electronic instructions that instruct the computer to do something at the request of the user. Software can be likened to the soul of a computer whose hardware is seen as the body.

Explanation:

6 0
3 years ago
SATCOM in the Ku- and Ka- bands, as well as EHF systems are adversely affected by rain (the higher the frequency, the greater th
kap26 [50]

Answer:Answer:

TRUE

Explanation:

SATCOM in the Ku- and Ka- bands, as well as EHF systems are adversely affected by rain (the higher the frequency, the greater the effect) because one of the factors that affects availability in a satellites is rain. Higher frequencies in Ka-band (30/20 GHz), rain can have a very large effect that simply cannot be overcome at the usual levels of availability.

Rain reduces the quality of signals by interfering with the signals thereby, reducing their strength and quality.

Therefore Rain can not only degrade a satellite's signal, it can also cause a complete outage of the satellite's.

4 0
4 years ago
What is an input to the Program Increment Planning process that highlights how Product Management plans to accomplish the Vision
Tatiana [17]

Answer:

Business Context

Explanation:

The input "business context" is an input to Program Increment Planning that helps understand what is the vision in Product Management.

6 0
3 years ago
To adjust the height or width to fit the dialog within it, you should use these options. Click all that apply
Blizzard [7]

Answer: manually drag the box to adjust the cell

Double-click the cell to adjust to largest size needed

In the Home tab’s Cells feature, select cell size.

Explanation:

I took the test.

8 0
4 years ago
Read 2 more answers
Things stored in a computer ram __________.
kirza4 [7]
B.cannot be accessed from the GUI
8 0
3 years ago
Other questions:
  • What is the danger in judging someone according to his or her social networking profile
    12·1 answer
  • What is does the word multimedia mean?
    5·2 answers
  • Sami is creating a web page for her dog walking business. Which item will set the theme for her page? Background color Heading c
    11·2 answers
  • !!General Chromebook Software Question!!
    14·2 answers
  • Write a program that sorts an array of 20 random numbersin the range from 0 through 1000.
    6·1 answer
  • What is the role of consumers in determining what is produced in a market economy
    15·2 answers
  • Heya! I’m quite lonely, so here are some points. I want to play some mc with others but the only version I’m able to play is edu
    11·2 answers
  • What are the two types of commennts of java​
    12·1 answer
  • One driving technique to increase fuel efficiency is.
    11·1 answer
  • write a recursive function that accepts an integer argument, n. the function should display n lines of asterisks on the screen,
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!