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
The animation industry is solely reliant on 3-D modeling and 3-D virtualization to create the animated movies in the cinemas.
loris [4]
False it is false people also hand draw stuff
7 0
3 years ago
Write a program that will open a file named thisFile.txt and write every other line into the file thatFile.txt. Assume the input
Naily [24]

Answer:

Check the explanation

Explanation:

The programmable code to solve the question above will be written in a python programming language <u><em>(which is a high-level, interpreted, general-purpose programming language.)</em></u>

<u><em /></u>

f = open('thisFile.txt', 'r')

w = open('thatFile.txt', 'w')

count = 0

for line in f:

   if count % 2 == 0:

       w.write(line)

   count += 1

w.close()

f.close()

4 0
2 years ago
Louis wrote a check of $100 to the electricity company. After a few days he received a Notice of Dishonor from the bank regardin
diamong [38]

the checked bounced because he didn’t have any money.

mark me brainliest please!!!!!

4 0
3 years ago
All of the following are common causes of electrical accidents and injuries, EXCEPT:
mote1985 [20]
<h3>✽ - - - - - - - - - - - - - - - ~<u>Hello There</u>!~ - - - - - - - - - - - - - - - ✽</h3>

➷ It would be D. I don't really see how the plug itself is a cause of electrical accidents.

<h3><u>✽</u></h3>

➶ Hope This Helps You!

➶ Good Luck (:

➶ Have A Great Day ^-^

↬ ʜᴀɴɴᴀʜ ♡

7 0
3 years ago
The temperature in toronto canada was-4°c and tje temperature in brixton,england was 6°c warmer. what was the difference in temp
Oksana_A [137]

Answer:

It is 10°c difference between them

7 0
3 years ago
Other questions:
  • Both the USB flash drive and the DVD are data storage devices, but they both have numerous differences. Both can contain insane
    6·1 answer
  • ) Consider a router that interconnects four subnets: Subnet 1, Subnet 2, Subnet 3 and Subnet 4. Suppose all of the interfaces in
    11·1 answer
  • To name a computed field, follow the computation with the word ____ and then the name you wish to assign to the field
    8·1 answer
  • You are to create a program using Python that asks the user for a nonnegative number, then computes the mean and variance using
    15·1 answer
  • Semiconductor memory is used mainly for primary storage even with its high cost. In another hand, the magnetic tape is the cheap
    9·2 answers
  • For the following array x [10] = { 45, 20, 50, 30, 80, 10, 60, 70, 40, 90} show the contents of x after the function call split
    6·1 answer
  • Please help!! thank you so much!! &lt;3
    14·2 answers
  • Question 3 10 points Save Answer Many companies in the computer industry introduce new products and services frequently in an at
    7·1 answer
  • Where can formatting features be found ?! Need help asp !‍♀️
    9·1 answer
  • Draw a flowchart that solve the problem of calculating the average of 5 numbers.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!