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
The Operating System is used to locate, move, and copy files.
Temka [501]

Answer:

Yes!! the operating system is used to locate, move, and copy file

7 0
3 years ago
How can you add and remove categories from a previously created chart? A. Click the Format tab. B. Click the Chart Styles button
hoa [83]
<span>Click the Chart Filters button.</span>
7 0
3 years ago
Read 2 more answers
When assigned to a cell, the __________ function returns a number that corresponds to the system date and time beginning with De
Sloan [31]

Answer:

Option D: NOW

Explanation:

In Microsoft Excel, NOW function can be used to return a serial number that  corresponds to the system date and time beginning with December 31, 1899.

The NOW function is useful when a date and time is required for calculation or display. The value will be updated each time we open the Excel worksheet.  To use the NOW function, we can type in the formula as follows:

<em>=NOW() </em>

7 0
3 years ago
2. Add a _______ to manually force text from one page to the next page. A. footer B. page break C. blank page D. header
Morgarella [4.7K]
The answer is: b) page break. 
5 0
3 years ago
Read 2 more answers
With a(n) ____ structure, you perform an action or task, and then you perform the next action in order.
e-lub [12.9K]
The answer is a <u>sequence structure</u>
8 0
3 years ago
Other questions:
  • When it comes to safety, the choice to be safe is often up to __________?
    8·1 answer
  • What is one problem you should keep in mind when researching information on the Internet?
    6·2 answers
  • Host to IP address lookup and its reverse lookup option are very important network services for any size network. It is also how
    14·1 answer
  • Which of the following statements about electronic cover letters is true?
    14·2 answers
  • When addictions escalate and the individual loses his or her job or drops out of school, _______________.
    12·2 answers
  • A or an is a simple chip with two or more processor core
    5·1 answer
  • Need help please asap
    9·1 answer
  • क) मानौं तिमी बसेको समाजमा मान्छेहरूले सधै फोहर फाल्ने गर्नाले वातावरण प्रदूषित
    13·1 answer
  • Please describe the role of games in modern society!
    5·2 answers
  • We can save our data peremently on a
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!