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
Elanso [62]
3 years ago
9

Write a function to output an array of ints on a single line. Funtion Should take an array and an array length and return a void

. It should look like this {5,10,8,9,1}
Computers and Technology
1 answer:
nikitadnepr [17]3 years ago
5 0

Answer:

void printarr(int nums[],int n)

{

   cout<<"{";//printing { before the elements.

   for(int i=0;i<n;i++) // iterating over the array.

   {

       cout<<nums[i];//printing the elements.

       if(i==n-1)//if last element then come out of the loop.

       break;

       cout<<",";//printing the comma.

   }

   cout<<"}"<<endl;//printing } at the end.

}

Output:-

5

1 2 3 4 5

{1,2,3,4,5}

Explanation:

I have created a function printarr of type void which prints the array elements in one line.I have used for loop to iterate over the array elements.Everything else is mentioned in the comments.

You might be interested in
What are source data entry devices​
matrenka [14]

Answer:

<u><em>Source data entry devices are used for audio input, video input and to enter the source document directly to the computer. Source data entry devices do not require data to be typed-in, keyed-in or pointed to a particular location.</em></u>

Explanation:

7 0
2 years ago
What is the output of this program?
Charra [1.4K]

Answer:

20

Explanation:

assuming the print statement is not indented, the program effectively calculates 2+5+6+7.

The range(...) is <em>excluding </em>the end value (8 in this case).

3 0
2 years ago
Read 2 more answers
Which options are available when a user modifies a recurring appointment? Check all that apply. Open this occurrence Open the fi
Rus_ich [418]

Open this occurence and open the series is the two options to choose from, from the dialog box that shows when attempting to modify the appointments

4 0
3 years ago
Read 2 more answers
Ms. Osteen gives her class an assignment to insert background color that gradually changes from blue to green. To accomplish thi
irina1246 [14]

Answer:

C

Explanation:

7 0
2 years ago
A _____ is a specially formatted file that, once mounted, or connected to a virtual machine appear and operate pretty much ident
Sever21 [200]

A <u>Virtual hard disk</u> is a specially formatted file that, once mounted, or connected to a virtual machine appear and operate pretty much identically to a physical hard drive.

<h3>What is a virtual hard disk?</h3>

A virtual hard disk (VHD) is a disk picture file format for storing the entire ranges of a computer's hard drive.

The disk image, sometimes called a virtual machine (VM), duplicates an existing hard drive, including all data and structural elements.

<h3>Why would you count a virtual hard disk?</h3>

Typically, a VHD comes in handy to add additional storage to a Hyper-V virtual machine, and thanks to its capacity to support other OS installations, you can even use this storage virtualization technology to make a dual-boot system without modifying an existing partition.

To learn more about  virtual hard disk , refer

brainly.com/question/4733444

#SPJ4

4 0
1 year ago
Other questions:
  • The "instance" relationship shows that something is an object of a ____.
    5·1 answer
  • Computer user support helps people with minor computer problems. <br><br> True or False
    12·1 answer
  • Cliff just started working with a client who has a very disorganized AdWords account. What’s an effective way for him to begin r
    15·1 answer
  • You need to extract data from the system your predecessor created. you discover tables have been created according to the third
    7·1 answer
  • Draw a datapath that can perform the following set of register replacement and combinational operations. Assume all registers ar
    5·1 answer
  • Sean works for a company that ships hospital equipment. He needs to calculate the weight of the items being shipped. He enters t
    12·1 answer
  • Select the correct answer from each drop-down menu.
    8·1 answer
  • What is the difference between PowerPoint and Outlook?
    5·1 answer
  • Rohan is creating a presentation with at least 50 slides. He wants the slides to use a consistent layout and formatting. Which o
    12·1 answer
  • Create a new data frame, first_south, by subsetting titanic to include instances where a passenger is in the first class cabin (
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!