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
Ymorist [56]
1 year ago
13

write a function print array to print an array on one line as: 9 8 7 6 5 4 3 2 1 0 write and test a function called bubble sort

that implements this sorting method and call it from your main function. you will need to swap elements to sort the array.
Computers and Technology
1 answer:
Lisa [10]1 year ago
4 0

Function print array to print an array on one line as:

void printArray(int arr[], int n)
{
   int i;
   for (i = 0; i < n; i++)
       printf("%d ", arr[i]);
   printf("\n");
}
void bubbleSort(int arr[], int n)
{
  int i, j;
  for (i = 0; i < n-1; i++)      
      for (j = 0; j < n-i-1; j++)  
          if (arr[j] > arr[j+1])
             swap(&arr[j], &arr[j+1]);
}
void main()
{
   int arr[] = {9, 8, 7, 6, 5, 4, 3, 2, 1, 0};
   int n = sizeof(arr)/sizeof(arr[0]);
   printf("Given array is \n");
   printArray(arr, n);
   bubbleSort(arr, n);
   printf("\nSorted array is \n");

What is array?
An array is a type of data structure used in computer science that contains a set of elements (values and variables), each of which is designated by an array index or key. The simplest type of data structure is indeed a linear array, also known as a one-dimensional array. For instance, an array of ten 32-bit (4-byte) arithmetic operations, to indices 0 through 9, may be stashed as ten words at memory addresses 2000,2004,2008,..., 2036 (in hexadecimal: 0x7D0, 0x7D4, 0x7D8,..., 0x7F4) so that the element with index

To learn more about array
brainly.com/question/24275089
#SPJ4

You might be interested in
If no other row matches, the router will select the ________ row as its best match. First Last either First or Last, depending o
zzz [600]

Answer:

Last

Explanation:

Routing is a term in engineering which involves the process of selecting a path for traffic in a network or across multiple networks. It is applicable in circuit-switched networks, such as the public switched telephone network (PSTN), and computer networks, such as the Internet. It is mostly used as a term for IP Routing.

Hence, in IP Routing, the first step is comparing the packet's destination IP address to all rows, followed by selecting the nest-match row. However, If no other row matches, the router will select the LAST row as its best match.

6 0
3 years ago
A Pool charges $4 each visit,or you can buy a membership. Write and solve an inequality to find how many times a person should u
MAXImum [283]
$4 x number of visits (V)> price of membership (M)
V > M/4
8 0
3 years ago
Which of the following should NOT be done to keep people from slipping on floors? A) Have the proper absorbents in an easy-to-fi
RoseWind [281]

The following options helps keep people from slipping on floors

A) Have the proper absorbents in an easy-to-find place to quickly put on spills : So that accidental little spills can be cleaned right away.

C) Wear slip-resistant footwear : It is a precautionary step to follow, no matter where we go.

D) Mark a slippery area with an easy-to-use tent sign that says " Caution, Slippery floor" : This allows people to be aware of the wet area and cross it cautiously.

Leaving oil and fluids to air dry thoroughly, takes a long time and there are chances that people step over it and slip.

So, the answer is

(B) Anytime oil or fluids are spilled on the floor, leave them to thoroughly air dry.

8 0
3 years ago
Read 2 more answers
What is a banner grab?
alexira [117]
Banner Grabbing is a technique used to gain information about a computer system on a network and the services running on its open ports. Administrators can use this to take inventory of the systems and services on their network.

Hope you find this helpful!
Brainliest and a like is much appreciated!
3 0
2 years ago
How does collaborating on a project improve its quality?
Serga [27]
Several different collaborations on a project introduce variety, perspective and give the people working together communication skills for business in the future.
7 0
3 years ago
Other questions:
  • when you cross or enter traffic from a full stop, how much space should you allow on city streets? on the highway?
    11·1 answer
  • You are going to be installing a videoconferencing system. One of the requirements of the system is that only workstations that
    10·1 answer
  • ____ languages create source code using words and structures similar to spoken language.​
    15·1 answer
  • CAD workstations
    11·1 answer
  • The amount of time taken by each of 10 students in a class to complete an exam is an example of what type of data? a. Cannot be
    15·1 answer
  • Victoria has a .... of playing with her hair when she gets nervous​
    9·1 answer
  • What is the output?
    7·1 answer
  • How to check the at&amp;t internet speed on my computer
    9·1 answer
  • Which statement is true of the digital sound produced by a computer using a<br> lower sample rate?
    9·1 answer
  • What enables image processing, speech recognition, and complex game play in artificial intelligence?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!