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
A laptop computer is smaller than desktop computer. True or false
alina1380 [7]

Answer:

true

Explanation:

4 0
3 years ago
Read 2 more answers
Answer the following questions:
Alika [10]

Answer:

nasaan po yung tanongkkkkk

8 0
3 years ago
In the microsoft powerpoint wiew ribbon. Which presentation wiew enables a user to view one slide at a time in the slide pain?
german

Answer:

The answer to this question is given below in the explanation section.

Explanation:

In the Microsoft PowerPoint view ribbon. A normal presentation view enables a user to view one slide at a time in the slide pain.

As we know that there are different views of presentation, such as, normal view, reading view, slider sorter, outline view, and note pages.

Only a Normal view allows you to see one slide at a time in the slide pain.

6 0
3 years ago
What do I do if I'm trying to get on a website and this pops up?
Andrew [12]

it means the website is no longer available because someone reported it


3 0
3 years ago
Read 2 more answers
A network uses category 3 cabling. It needs to be upgraded so that it can support faster 1 Gbps applications. In this situation
Hitman42 [59]

Answer:

The answer is "Category 5 cable".

Explanation:

It is also known as Cat 5 or class 5, but many of us consider it just "Ethernet wire". It was established in the early 1990s, which was included by the Electronics Industry group and the Telecom industry Association. It uses a twisted pair cable, which is used for carrying signals.  

  • It supports up to 100 MHz capacity and can be used for 10Base-T, 100Base-TX, or perhaps 1000Base-T Gigabit.
  • It is the right solution for four twisted pairs of copper cable that attached to the RJ-45 connector.
4 0
3 years ago
Other questions:
  • Alice's Restaurant Supply offers a line of specialty food products to institutional
    6·1 answer
  • A collision between gas atoms and electrons raises the energy levels of oxygen and nitrogen in the _________.
    8·2 answers
  • Given an int as the input, print all the factors of that number, one in each line. For example, if the input is 15 The output wi
    14·2 answers
  • What is included on the HP PC Hardware Diagnostics 3-in-1 USB Key that allows you to recover systems that cannot boot?
    14·1 answer
  • -1
    13·1 answer
  • How does this happen on brianly???
    5·2 answers
  • The L-exclusion problem is a variant of the starvation-free mutual exclusion problem. We make two changes: as many as L threads
    15·1 answer
  • Write a C++ function with the following signature: void readAndConvert() The function takes no parameters and returns no value.
    6·1 answer
  • Given a sorted list of integers, output the middle integer. assume the number of integers is always odd.
    11·1 answer
  • The rules of a programming language constitute its__________________
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!