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
Use the drop-down menus to complete the steps to share a presentation through OneDrive.
charle [14.2K]

Answer:

Share

OneDrive

In real time

Send

Explanation:

5 0
3 years ago
Four reasons why computers are powerful
zlopas [31]

Answer:

You could search up almost anything you want

they have a lot of storage

you can find good information

they help you with a lot of things

Explanation:

also how they can process information in seconds

4 0
2 years ago
A puppy weighed 6 ounces at birth. After two weeks, the puppy weighed 14 ounces. How much did the puppy gain? Model the equation
ivann1987 [24]
+8 ounces ...don't know what an alrebra tile so I just subtracted :)
7 0
2 years ago
Read 2 more answers
Why did it take hundreds
levacccp [35]
Before that there was no way for the image to be recorded and fixed on a surface
5 0
2 years ago
Does woman hair grow over time in dayz?
zhenek [66]
It grows but not drastically but you’ll be able to see the difference of length in a few months or even years depending on the person.
6 0
2 years ago
Other questions:
  • When transporting data from real-time applications, such as streaming audio and video, which field in the ipv4 header can be use
    14·1 answer
  • PowerPoint is great for brainstorming and producing creative pieces because it
    13·2 answers
  • Create a loop that will output all the multiples of 5 that are greater than zero and less than 60 (do not include 60). 5, 10, 15
    10·1 answer
  • What do these terms have in common? google, yahoo!, bing they are important books. they are internet search engines. they are wo
    10·1 answer
  • What are the pasting options in Outlook 2016? Check all that apply.
    10·2 answers
  • What is TLB for? Why TLB? Given the following number, what is theeffective memory access time?
    11·1 answer
  • It took her 9 more months but Marina has managed to save the full $725 plus more to cover fees to pay off the pay-day loan compa
    9·1 answer
  • Pa answer po thank you​
    7·2 answers
  • How to scan a screenshot on Brainly?
    9·2 answers
  • Why is technology bad for you
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!