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]
2 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]2 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
When you use the bufferedreader class, you must import the ____ package into your program?
BigorU [14]
When you use the bufferedreader class, you must import the java.io package into your program.  It is<span> an API that comes with </span>Java<span> which is aimed at reading and writing data (input and output). ... For instance, read data from a file and write to a file or write a response back over the network. The </span>Java IO<span> API is located in the </span>Java IO<span> package ( </span>java.io<span> ).</span>
5 0
3 years ago
What are the three fundamental elements of an effective security program for information systems?
marishachu [46]
<span>the three fundamental elements of an effective security program for information systems are Identification, Authentication and Authorization.The access control creates the user and assigns the rights to resources and authorization is giving permissions to the users to access the resources.The user who wants to enter the system should have a valid data t enter the system like password, fingerprint or any other type of recognition.</span>
4 0
3 years ago
Read 2 more answers
witch option in a presentation program contains the formatting and placeholders for all the items that appear on a slide?
Nikitich [7]

SWITCH BETWEEN OPEN PRESENTATIONS. ..... Presentation software is a program designed for the production and display of .... image file format and version number. 1. .... Option. To Do This. Normal. Contains three panes: the outline pane, the slide pane, and the notes pane. .... appear on every slide in a presentation.

7 0
3 years ago
Read 2 more answers
Select the correct answer from the drop-down menu. Olivia composed a layout with the image below for a seasonal greeting card. W
amid [387]

Answer:

repetition

Explanation:

the umbrellas are repeated

6 0
2 years ago
Which of the following processes allows animators to use computers to input human movement that can later be transformed to crea
nadya68 [22]
Motion Capture. "it's a combination of rotoscoping with newer computer technology, allowing people to use live footage as the basis for animation without having to go through the process of drawing over it." -scienceworld .ca
7 0
2 years ago
Read 2 more answers
Other questions:
  • How do you spell kiss in Japanese
    13·2 answers
  • So, I have strict parents &amp; need help, if u don’t know how to fix this after u read it, leave. I don’t want u getting points
    11·2 answers
  • Special effects are added using the _____.
    16·1 answer
  • The three tasks within data harmonization, namely: data consolidation, data cleansing, and data formatting use techniques called
    8·1 answer
  • Which window allows you to view and change your computer's system information and settings?
    9·2 answers
  • What is the best way to learn JavaScript?
    5·2 answers
  • What are the reasonsfor documenting business rules​
    6·1 answer
  • What is a computer modem?​
    9·1 answer
  • Write steps for converting decimal to binary numbers?
    13·1 answer
  • Help its in binary and im a small brain for that
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!