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]
3 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]3 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
Is it possible for the front and rear references in a circular array implementation to be equal?
azamat

Answer:

Yes it is possible for the following cases:-

  1. When the queue is full.
  2. When the queue is empty.

Explanation:

When the queue is full the the front and the rear references in the circular array implementation are equal because after inserting an element in the queue we increase the rear pointer.So when inserting the last element the rear pointer will be increased and it will become equal to front pointer.

When the queue is empty the front and rear pointer are equal.We remove an element from queue by deleting the element at front pointer decreasing the front pointer when there is only one element and we are deleting that element front and rear pointer will become equal after deleting that element.

7 0
3 years ago
Which of these sedimentary rocks is made of the largest particles?
Marta_Voda [28]
Your answer is <span>A.conglomerate.

Hope this helps :)</span>
6 0
4 years ago
2 2.2.4 Quiz: Setting Up a Business Letter
AVprozaik [17]

Answer: It is made up of several records.

Explanation: I just got it right in Ape x

4 0
3 years ago
A misplacement of punctuation or spacing in a command during programming that causes the program to stop running is most
larisa [96]

Answer:

Compiler error

6 0
3 years ago
Read 2 more answers
9. Which Incident Type is limited to one operational period, does not require a written Incident Action Plan, involves Command a
SIZIF [17.4K]

Answer:

B. Type 4

Explanation:

Type 4 incident type does not require a written IAP but documented operational briefing will be completed for all incoming resources. Also, several resources are required to mitigate the incident, including a task force or strike team. If needed, the command and general staff functions are activated. The incident is usually limited to one operational period in the control phase and the agency administrator may have briefings, and ensure the complexity analysis and delegation of authority is updated.

8 0
3 years ago
Read 2 more answers
Other questions:
  • What is the purpose of a budget
    7·1 answer
  • How efficient would a 6-bit code be in asynchronous transmission if it had 1 parity bit, 1 start bit, and 2 stop bits?
    5·1 answer
  • In order to protect your computer from the newest virus, which of the following should you do after you've installed a virscan s
    9·1 answer
  • Naseer has inserted an image into his document but needs the image to appear on its own line.
    14·2 answers
  • Why should you follow up with your interview after a job interview
    15·2 answers
  • Given a variable s associated with a str, write an expression whose value is a str that is identical except that all the letters
    15·1 answer
  • Write a recursive method called repeat that accepts a string s and an integer n as parameters and that returns s concatenated to
    7·1 answer
  • In which area is composing for games similar to composing for
    14·1 answer
  • In 5-10 sentences, describe the procedure for responding to an e-mail message.
    5·1 answer
  • Answer this if you can help me!
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!