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
Multimedia computer system required the following hardware component they are what​
Lady bird [3.3K]
To develop the system of multimedia we use the various hardware/softwarecomponents are:

The CPU: The CPU, which

is recommended for a multimedia computer should be Pentium IV or other advanced chips. The Monitor: The multimedia PC should be equipped with a monitorhaving Super

Video Graphics Arrays (SVGA) card.

Mark me as brainliest please
3 0
2 years ago
Define types of hacker ?plz help me with this question​
denis-greek [22]

Answer:

the types of hacker attacks and techniques. White Hat Hackers. Black Hat Hackers. Gray Hat Hackers. Script Kiddies.

Explanation:

i don't know if this can help you

8 0
2 years ago
Read 2 more answers
Westion<br> ufycfl<br> to city first city trusty court you to they'd
Helen [10]
I don’t understand. Please tell me the question
6 0
3 years ago
Determining which computer platform (operating system) would be best for a particular student often depends on what the student
leva [86]

Answer: Window OS

Explanation:

Based on the information given, it should be noted that the students who plan to study graphic design should consider the Window OS platform since it is considered to be the industry standard in those fields.

Microsoft Windows, also refered to as the Windows OS, is a computer operating system that's developed by Microsoft to run personal computers. It has the first graphical user interface and also, the Windows OS dominates the personal computer market.

4 0
2 years ago
The address entered into a web browser (firefox, safari, chrome, ie) is technically called a?
Nimfa-mama [501]

Answer: Website Bar

Explanation:

7 0
1 year ago
Other questions:
  • You have installed a streaming video service on your network. You want selected hosts to be able to access this service via a dy
    6·1 answer
  • 1. of the following individuals, who was the most recent to develop information searching tools online? (points : 1) otlet wells
    5·1 answer
  • You have users who connect to the corporate network using their laptops. because these computers often access confidential data,
    9·1 answer
  • Which risk management framework does the organization of standardization publish
    13·1 answer
  • How do you use a iPad when it has a password ?
    9·2 answers
  • Which component is a part of the CPU of a computer
    12·2 answers
  • In this unit, you developed your skills at coding in Python. In this lab, you will put those skills to work by creating a progra
    8·2 answers
  • WHAT DOES THE SCRATCH CODE BELOW DO?
    7·1 answer
  • Computing devices translate digital to analog information in order to process the information
    12·1 answer
  • Tim Berners-Lee cultivated a way to interconnect and self-index data. He made a major contribution to the development of the Int
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!