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
Which phrase best describes a scenario in Excel 2016?
alexira [117]

Answer:

<h2>YEET B </h2>

Explanation:

Sorry

Its B: a type of what-if analysis that allows a user to define multiple variables for multiple functions or formulas

(i think)

3 0
3 years ago
Read 2 more answers
-Which of the following is true about Web services?
Lynna [10]

Answer:

The answer is "Option D".

Explanation:

Web service is also known as an online open software product, which uses a common XML messaging service system. It is used service like HTTP, SOAP, etc, that encrypts messages from all web services.

  • It uses the internet, that enables you the interface or application for the user interaction or exchanging data.
  • It will turn the software into web apps.
7 0
3 years ago
The Ntds. dit file is a database that stores Active Directory data, including information about user objects, groups, and group
vladimir2022 [97]

Answer:

I hate it

Explanation:

Mark it as the brainliest if u love god

8 0
2 years ago
A cache has been designed such that it has 512 lines, with each line or block containing 8 words. Identify the line number, tag,
Reptile [31]

Answer:

Given address = 94EA6_{16}

tag = 0 * 94  ( 10010100 )

line = 0 * 1 D 4 ( 111010100 )

word position = 0*6 ( 110 )

Explanation:

using the direct mapping method

Number of lines = 512

block size = 8 words

word offset = log ^{8} _{2}  = 3 bit

index bit = log^{512}_{2}  = 9 bit

Tag = 20 - ( index bit + word offset ) = 20 - ( 3+9) = 8 bit

Given address = 94EA6_{16}

tag = 0 * 94  ( 10010100 )

line = 0 * 1 D 4 ( 111010100 )

word position = 0*6 ( 110 )

8 0
3 years ago
Which tool in Access will give you a detailed report showing the most accurate and complete picture of
Angelina_Jolie [31]

The Query tool is the tool in MS access that will give user detailed report showing the most accurate and complete picture of employee attendance grouped by day

<h3>What is the Query tool?</h3>

The Query tool helps to give answer to a simple question, perform calculations, combine data from a database

In conclusion, the Query tool is the tool in MS access that will give user detailed report showing the most accurate and complete picture of employee attendance grouped by day

Read more about Query tool

<em>brainly.com/question/5305223</em>

4 0
2 years ago
Other questions:
  • 14. Which commercial RDBMS product was the first to hit the market and is the biggest?
    15·1 answer
  • James, a technician, needs to format a new drive on a workstation. He will need to configure read attributes to specific local f
    5·1 answer
  • True or false? A medical assistant can check for available exam rooms and providers using an electronic scheduling system.
    8·1 answer
  • Which of the following events would most likely produce an earthquake
    7·1 answer
  • I have a question on an IT crossword the question is as follows
    12·1 answer
  • Match each career with the education required for each job
    12·1 answer
  • Two technicians are discussing a parasitic load test. Technician A says that the parasitic load is measured with an ammeter Tech
    13·1 answer
  • Which actions are available in the Trust Center? Check all that apply.
    8·1 answer
  • Which 1947 Invention paved the way for the Digital Revolution?
    12·2 answers
  • Post back maintains view state by assigning the form values to a hidden form field named ____.
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!