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
Darya [45]
2 years ago
10

write a program that will create an array of 100 random integers in the range from [0,99] pass the array to a function, printarr

ay(), that will print the values of the array on the monitor. pass the array to a function, sortarray(), that will sort the array. Pass the array to printarray() again and print it in increasing order
Computers and Technology
1 answer:
slava [35]2 years ago
5 0

Answer:

In C++:

#include <cstdlib>  

#include <ctime>  

#include <iostream>

#include <bits/stdc++.h>

using namespace std;

void printarray(int array []){

for(int i=0; i<100; i++){         cout << array[i] << " ";    }

}

void sortarray(int array []){

sort(array, array + 100);

   printarray(array);

}

int main() {  

   int array[100];

   srand((unsigned)time(0));  

   for(int i=0; i<100; i++){  array[i] = (rand()%99);     }

   printarray(array);

   cout<<endl;

   sortarray(array);

   return 0;

}

Explanation:

<em>See attachment for program source file where comments are used for explanation purpose</em>

Download cpp
You might be interested in
Describe the layout of an article on Wikipedia​
GuDViN [60]

An article with a table of contents block and an image near the start, then several sections

Sample article layout (click on image for larger view)

This guide presents the typical layout of Wikipedia articles, including the sections an article usually has, ordering of sections, and formatting styles for various elements of an article. For advice on the use of wiki markup, see Help:Editing; for guidance on writing style, see Manual of Style.

Contents

1 Order of article elements

2 Body sections

2.1 Headings and sections

2.2 Names and orders for section headings

2.3 Section templates and summary style

2.4 Paragraphs

3 Standard appendices and footers

3.1 Headings

3.2 Works or publications

3.3 "See also" section

3.4 Notes and references

3.5 Further reading

3.6 External links

3.6.1 Links to sister projects

3.7 Navigation templates

4 Specialized layout

5 Formatting

5.1 Images

5.2 Horizontal rule

5.3 Collapsible content

6 See also

7 Notes

8 References

A simple article should have, at least, (a) a lead section and (b) references. The following list includes additional standardized sections in an article. A complete article need not have all, or even most, of these elements.

The same article, with the central left highlighted: it contains just text in sections.

Body sections appear after the lead and table of contents (click on image for larger view).

Articles longer than a stub are generally divided into sections, and sections over a certain length are generally divided into paragraphs; these divisions enhance the readability of the article. The names and orders of section headings are often determined by the relevant WikiProject, although articles should still follow good organizational and writing principles regarding sections and paragraphs.

5 0
2 years ago
Ima go to sleep but I ask a favor can u guys go on eBay Amazon and find the cheapest pre bilt that is actually good
katrin2010 [14]

Explanation:

what do specifically want to buy??

8 0
3 years ago
Read 2 more answers
Which statement is accurate to describe a spreadsheet versus an Excel workbook?
Tomtit [17]
C is the correct answer
5 0
2 years ago
What would be the output of the following program?
Natalka [10]

Answer:

Output: 2004 2008 2058  

Explanation:

In the first printf command it will print the address of the variables num, msg1, msg2. And in the second printf command it will print the values of the variables num, msg1, msg2. As the address of the structure is 2004 And the size of the integer is 4 byte so size will increase with 4 bytes and the size of character is 1 byte so it will increase by 1*50= 50 bytes.

Hence, the output is 2004 2008 2058  

8 0
3 years ago
give an example of both a negative and positive coping mechanism you could use to deal with this stress?
Andru [333]

Answer:

Negative coping mechanism deals with Substance dependence, abuse, and use; anger, violent mentality, risky mentality, dangerous mentality, reminders such as trauma, etc.

The positive coping mechanism can be like an attempt to transform or change the issue into something other than that. As an example, it can be like converting a stressful situation into a positive situation.

Explanation:

Please check the answer section.

4 0
3 years ago
Other questions:
  • You are reluctant to write an extra credit book report because you are afraid that your language and punctuation skills are not
    11·1 answer
  • What is an example of asynchronous communication
    7·1 answer
  • When u look at a green object through red glass the object will appear
    11·2 answers
  • What Word feature is seen below?
    10·1 answer
  • Larry sent an email to Andy. Andy didn't open Larry's email but still understood what the message was. How did Andy determine th
    14·1 answer
  • Wrtie a program in which we will pass a value N. N can be positive or negative. If N is positive then output all values from N d
    8·1 answer
  • To convert microseconds to nanoseconds: a. Take the reciprocal of the number of microseconds. b. Multiply the number of microsec
    13·1 answer
  • This is your code.
    9·1 answer
  • A video game controller contains the buttons: A, B, X, Y. When the player presses A their character Jumps. When the player press
    15·1 answer
  • A health care provider approaches Accenture to help them increase their efficiency through an advanced data science platform.Wha
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!