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
What effect did personal computers and internet have on how people acces information
Ganezh [65]
Personal computers made accessing information a lot faster and easier but a lot of times the things we see when we search information is tailored to our personal beliefs and opinions. For example, if you're a person that commonly searches for information or products about dogs, you're way less likely to get an add promoting cat food. While this may seem like a very positive thing, it also may have a downside. This rule also applies to things like political views, if you're a trump supporter you'll most likely end up seeing things that are pro-Trump and a lot fewer things that are pro-Hilary. 

This can skew people's outlooks on certain subjects, if you're only ever seeing web pages and articles saying that Trump is great, you won't ever see the opposing side which is essential in making a well-informed decision about a candidate for the presidency or any other subject for that matter.

In summary, You have to see both the good and bad side of something to truly make a choice and the way the internet works can sometimes make that difficult.


I hope this helps and makes sense! :)
6 0
3 years ago
Read 2 more answers
The user does not need to highlight data within an Excel worksheet in order to remove conditional formatting. True or false
san4es73 [151]

True

Excel 2019 makes it easy to remove conditional formatting since users do not need to highlight data in order to remove it.

5 0
3 years ago
Which of the following statements about the OSI is FALSE?A. The OSI model encourages modular design in networking.B. Each protoc
Afina-wow [57]

Answer:

The correct answer to the following question will be Option B.

Explanation:

<u>Open System interconnection:</u>

  • A practical and conceptual layout that describes network communication that will be used by the systems that are accessible to interconnection as well as other systems, is called the OSI model. This may also be referred to as the OSI model with seven layers.
  • The OSI model aims to direct developers and creators so that they would modularize with the wireless communication devices and computer programs they build, and to promote a consistent structure that defines the features of a network or telecom system.

Therefore, Option B is the right answer.

8 0
3 years ago
7. Accepting things that happen without trying to change them is known as
alukav5142 [94]

Answer:

accept people for who they are instead of trying to change them

Explanation:

i don't know if this is right or wrong but i hope this helped you :)

3 0
3 years ago
Write a simple Html structure and explain the meaning of each line
seropon [69]

Answer:

HTML stands for HyperText Markup Language and is the basic structural element that is used to create webpages. HTML is a markup language, which means that it is used to “mark up” the content within a document, in this case a webpage, with structural and semantic information that tells a browser how to display a page. When an HTML document is loaded by a web browser, the browser uses the HTML tags that have marked up the document to render the page’s content.

There are three types of code that make up a basic website page. HTML governs the structural elements, CSS styles those elements, and JavaScript enables dynamic interaction between those elements.

7 0
2 years ago
Other questions:
  • Suppose that cells B1 through B100 of an Excel spreadsheet contain the quantity of units ordered on each of 100 different days.
    13·1 answer
  • Very large and very small numbers are easier to write in scientific notation. For example, the number, 0.000000728 would be writ
    7·1 answer
  • Fax machines, voice mail, electronic mail, and electronic conferencing are all examples of _________.
    15·2 answers
  • Which categories format cells
    14·2 answers
  • How can I collect tweets from different accounts concurrently and categorize the tweets in a corpus?
    15·1 answer
  • Tools enable people to connect and exchange ideas
    7·2 answers
  • A web application is an example of:
    7·1 answer
  • What is TCP/IP adress​
    10·1 answer
  • ____ Is an Internet service that allows users to send and receive short text messages In real time.
    10·1 answer
  • Consider the following method, which is intended to count the number of times the letter "A" appears in the string str.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!