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
Select the true statement from the choices below. Group of answer choices Invalid code may cause browsers to render the pages sl
IrinaK [193]

Answer:

(A) A web page will not display in a browser unless it passes syntax validation testing.

(C)A web page must pass syntax validation testing before it is used.

Explanation:

A website is a collection of related web pages. A web page is an electronically arranged content page, designed and developed using web development application and language tool and hosted on a web server.

Web page or application development follows a series of well defined stages called software development life cycle (SDLC). The web application must go through these processes from birth to the end-of-life of the application.

The validation testing in SDLC, consisting of unit, acceptance and loading testing, which checks for syntax error or bugs on the written codes, because bugs could slow the loading of the page or even the display and browser compatibility of elements in the code.

5 0
3 years ago
Write an efficient C++ function that takes any integer value i and returns 2^i ,as a long value. Your function should not multip
Ilya [14]

Answer:

long power(int i)

{

   return pow(2,i);

}

Explanation:

The above written function is in C++.It does not uses loop.It's return type is long.It uses the function pow that is present in the math library of the c++.It takes two arguments return the result as first argument raised to the power of second.

for ex:-

pow(3,2);

It means 3^2 and it will return 9.

4 0
3 years ago
What frequency band is used by bluetooth, 802.11b, and 802.11g?
bagirrra123 [75]
802.11 is a Wi-Fi standard, not a frequency, both of those operate at 2.4 GHz. Bluetooth operates at frequencies between 2402 and 2480 MHz, or 2400 and 2483.5 MHz. 
4 0
3 years ago
Mention five importance of taskbar​
sveticcg [70]

Answer:

The taskbar is an element of an operating system located at the bottom of the screen. It allows you to locate and launch programs through Start and the Start menu, or view any program that's currently open.

6 0
2 years ago
Taylor develops a prototype for a new smartphone. It only includes code, a way to process the input, a memory card, and a microp
marysya [2.9K]

Answer:

i would say C.output

Explanation:

the program would be the code, the input would be the input, and the memory card would be the memory leaving the output as the only thing forgotten.

6 0
3 years ago
Read 2 more answers
Other questions:
  • Finding information on the web was made easier by _____________, which provide on-screen menus, making navigation of the web as
    12·1 answer
  • Which of the following is a type of monitor port?
    10·1 answer
  • ________ are used to translate each source code instruction into the appropriate machine language instruction.
    11·1 answer
  • Consider the following partial class definitions: public class A1 { public int x; private int y; protected int z; ... } public c
    12·1 answer
  • Which of the following is an example of new and emerging classes of software?
    11·1 answer
  • After a chart has been inserted and formatted, is it possible to change the data range it refers to or to add new rows of data?
    14·1 answer
  • Mariah was working on a multimedia presentation that included both video and audio files. The file was huge, and she wanted to s
    13·2 answers
  • Select the correct word to complete the sentence
    11·2 answers
  • What effect would excluding quotation marks from a search phrase have?
    12·1 answer
  • What do you think entertainment or gaming platforms will look like in the future?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!