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 special type of loans for houses
marin [14]

Answer:

Mortgage Loan

Explanation:

Idk if this is the right answer but I hope it helps. If you get it wrong im sorry.

6 0
2 years ago
Read 2 more answers
How do graphic designers showcase their work?
Luda [366]

They showcase it digitally since their work is done on computers.

6 0
3 years ago
Read 2 more answers
Steps to log out of an email account ​
Alexxx [7]

Explanation:

Hey there!

While logging out an email remember follwing steps;

  • Go to email and choose account to be removed.
  • Click on manage accounts.
  • Your email will be there, click on it.
  • Then click remove account.

[ You can also go to setting and click on account and then choose google account and click on it and remove it.]

This probably means removing account only but not logging out but works lije that only and when you need it you can again open it, like logging out and logging in.

<em><u>Hope</u></em><em><u> </u></em><em><u>it helps</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em>

4 0
3 years ago
Read 2 more answers
Steve left his computer switched on in his room and went out to have breakfast. When he returned, he saw that the monitor had be
yanalaym [24]

Answer:

B

Explanation:

5 0
3 years ago
What is known as networking in the IT field?
Sidana [21]

Answer:

r u Kate tell me plz I love u baby tell me please

4 0
2 years ago
Other questions:
  • Easy question how the internet has impacted y’all life
    13·1 answer
  • Multiple systems try to send data at the same time. The electrical impulses sent across the cable interfere with each other. Wha
    15·1 answer
  • i got a set of headphones and when i plug them into my speakers the right side only works how do i fix the left side of them
    12·1 answer
  • Counter-controlled repetition is also known as:
    8·1 answer
  • In which of the following situations will a macro make your work more efficient?
    9·1 answer
  • Importance of availability of mobile devices content that is of interest for users.
    12·1 answer
  • Write python code that does the following: Ask the user to enter as many as number they want; Then find the sum and the average
    10·1 answer
  • What statement best describes entrepreneurship?
    7·2 answers
  • Escribe 10 ejemplos de lo que consideras un byte
    5·1 answer
  • What is the meaning of FTTH
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!