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
Can some one help please
quester [9]

Answer:

I think its screenplay

Explanation:

Firstly, the question starts with an a so it can't be b. And format can't be repeated. Which leaves us with screenplay.

Hope this helps.

8 0
1 year ago
15. What type of presentation includes information created in a different Office application?
blondinia [14]
 the answer to the question is a Embedded ( I just learned this like a month ago so im pretty sure it right :))
4 0
3 years ago
Gettier contributed to what we know about the __________ model, while Rosch contributed to what we know about the __________ mod
svet-max [94.6K]

Gettier contributed to what we know about the exemplar model, while Rosch contributed to what we know about the prototype model. Prototype and exemplar theories are both versions of statistical theories of concepts. Prototype theories hold that concepts represent categories by means of a summary of the typical properties that category members possess, while exemplar theories hold that concepts represent categories by means of a cluster of individual category members that may be used to extract the statistical central tendency of the category.

6 0
3 years ago
Read 2 more answers
If a line is 4’ and you scaled it using 1/8” =1’ what would the size of the line be?
Gnesinka [82]
One half inch to scale
8 0
3 years ago
Choose the correct statement:_______.
olga2289 [7]

Answer:

d. A String is a class data type so a String variable holds a reference to a location in memory

It depends on which programing language or scripting language...

Explanation:

If it's Java then D is the correct answer...

6 0
2 years ago
Other questions:
  • _____ documentation is designed to help programmers and systems analysts understand the application software and maintain it aft
    12·1 answer
  • 1. Access and PowerPoint are not included in all configurations of Microsoft Office 2013.
    14·1 answer
  • The _____ is a blinking vertical line that indicates where the next typed character will appear. scroll box sheet tab insertion
    7·1 answer
  • You are the administrator of a Windows network. When creating a new user account, you specify a security clearance level of top
    8·1 answer
  • Suppose that outFileis an ofstreamvariable and output is to be stored in the file outputData.out. Which of the following stateme
    14·1 answer
  • ap csp The local, remote, and upstream _______ can each have multiple ___ _____. When a participant in a collaborative group on
    5·1 answer
  • What is a flowchart​
    9·1 answer
  • What does the Python print() function do?
    7·1 answer
  • ....................................................................................................
    12·1 answer
  • Which of the following tells the computer hardware what to do? A Information B) Software Procedures D People
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!