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
13. By adding built-in writable memory to its cartridge, Nintendo’s _________________ was the first console game that gamers cou
Rzqust [24]

The answer is c
Explanation:
5 0
3 years ago
Which option will enable Mina to apply several formats to the spreadsheet cells at the same time?
madam [21]
Applying a cell style will enable Mina to apply several formats to the spreadsheet cells at the same time.  <span>To apply several formats in one step, and to make sure that cells have consistent formatting, you can use a cell style. A cell style is a defined set of formatting characteristics, such as fonts and font sizes, number formats, cell borders, and cell shading. </span>
4 0
3 years ago
Which organization developed a network called CSNET to provide a network free to all American research and educational instituti
Citrus2011 [14]
<span>The National Science Foundation (NSF) is the organization which </span><span>developed a network called CSNET to provide a network free to all American research and educational institutions. It is an agency in the government of the United States that is responsible for research and development in the field of science and engineering. </span>
7 0
3 years ago
What does the windows update feature allow you to do?
Mariulka [41]
The answer is D
Explanation: none
3 0
3 years ago
Read 2 more answers
Assume that a single page of printed text requires 52 lines of text, and that each line of text averaged 80 characters. If each
zysi [14]

Answer:

4160000 bytes

Explanation:

One page = 52 lines of text

One line of text = 80 characters

=> One page = 80 x 52 = 4160 characters

Therefore, 500 pages of text will have 4160 x 500 characters = 2080000 characters.

Since 1 character takes up 2 bytes of computer memory, it impleies that a 500 page novel will take up 2080000 x 2 bytes = 4160000 bytes.

5 0
3 years ago
Other questions:
  • The purpose of the ________ element is to describe the contents of a table.
    15·1 answer
  • The syntax for multiplication function is ____________.
    8·1 answer
  • Which of these expressions evaluates to 4.0?
    12·2 answers
  • When creating a chart or graph, which should be completed first?
    9·2 answers
  • I keep getting this error: postfix.cpp: In function ‘double RPN_evaluation(std::string)’: postfix.cpp:42:26: error: cannot conve
    7·1 answer
  • How to be good at photography?
    5·2 answers
  • Karin realized that a song takes up a lot more space on her computer than the lyrics of the song typed out in ms word document .
    12·1 answer
  • What is the role of computer in education sector?​
    13·1 answer
  • What are the tools in creating an animation?
    7·1 answer
  • Colorful bead bracelet in codehs
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!