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
LiRa [457]
3 years ago
5

Write a program that implement a bubble sort ?

Computers and Technology
1 answer:
Tanzania [10]3 years ago
6 0

Answer:

 A program that implement a bubble sort:

 #include<iostream.h>

 #include<conio.h>

 

int main()

{

int ar[50],no,i,j,temp;

cout<<"Enter array size ";

cin>>no;

cout<<"Enter array elements ";  

 

for(i=0;i<no;++i)

 cin>>ar[i];

 

for(i=1;i<no;++i)

{

 for(j=0;j<(no-i);++j)

  if(ar[j]>ar[j+1])

  {

   temp=ar[j];

   ar[j]=ar[j+1];

   ar[j+1]=temp;

  }

}

 

cout<<"Bubble Sort array";

for(i=0;i<no;++i)

 cout<<" "<<ar[i];

 

return 0;

}

You might be interested in
Pro and Cons of Artificial Intelligence in Art <br><br> You must have 3 statements in each
Anni [7]

Answer:

The answer is below

Explanation:

Aritifiaicla intelligence in art is an artwork created by the application of artificial intelligence software.

Some of the pros of artificial intelligence in the art are:

1. It creates a new and improved interface, specifically in graphic design such as virtual reality and 3D printing

2. It creates and mixes the artistic ideas properly, such as mixing of different instruments in music to creates a new sound

3. It establishes graphical and visual display with no blemishes o,r error when applied accordingly, such as AUTOCAD

The cons of artificial intelligence in art are:

1. Artificial Intelligence lacks emotional sense. Hence it is challenging to display artistic elements that portray genuine emotions

2. It lacks creativity. Unlike humans, artificial intelligence is not as creative as humans when it comes to words or sentence constructions in an artistic sense.

3. It doesn't apply experience to its productions. Arts can be improved with more understanding of what is happening in the society or environment; artificial intelligence cannot translate its experience into arts formation.

6 0
3 years ago
Preesure is drived quantity? why​
Marrrta [24]

Answer:

Basically, anything quantity that is not defined as one of the 7 base quantities is a derived quantity by definition. Pressure is not one of the 7 base quantities. Hence it is a derived quantity.

6 0
4 years ago
Read 2 more answers
to protect a windows 10 system, you've configured system restore to automatically protect your system using restore points. will
zheka24 [161]

This can't adequately protect the user data on the system as one needs to enable file history.

<h3>How to depict the information?</h3>

In order to protect a windows 10 system, one will need to configure the system restore to automatically protect your system using restore points.

Despite this, this can't adequately protect the user data on the system as one needs to enable file history.

Learn more about windows on:

brainly.com/question/25243683

#SPJ12

8 0
2 years ago
The benefits associated with AAA are increased security, increased control over the network, and the capability of auditing your
MrRissso [65]

Answer:

The answer is letter A.

Explanation:

The statement is true. The benefits associated with AAA are increased security, increased control over the network, and the capability of auditing your network.

6 0
4 years ago
Do you think the current system of punishment in the United States works? Why? What would you change?
Simora [160]

Well the fact that jails are overcrowded is one factor that shows it's not working. Some people need help from past traumas, abuse, etc. Not everyone that acts out needs to be incarcerated, they need rehabilitation or counseling. Definitely depends on the crime committed. Therefore substance abuse users would be in rehabilitation. Even Juveniles in detention centers don't benefit from incarceration for certain offenses. There is no rehabilitation in incarceration. There are more criminals in jail and incarceration in my opinion, only for some offenders, is the last option. Now for Sex Offenders, Murderers and Criminals with violent crimes my opinion is completely opposite. Some of those offenders should be dealt with according to their crime. Also, all of the people that have been pardoned and them lessening time for drug traffickers and actual drug dealers (not necessarily users) is just a bad thing to pardon them or let them out because they don't have any violent crimes. Isn't dealing drugs, that are killing people every single day just as bad as a violent crime. In my opinion they can sit and rot for the longevity of their sentence. Some need help and I would fully support that only under some circumstances. Others I would rather not have to live amongst them.

8 0
3 years ago
Other questions:
  • You're allowed to use a cell phone while driving as long as there isn't any oncoming traffic.
    8·2 answers
  • Before sharing a document, you must first save the document to
    12·1 answer
  • A customer has a web server for a small business. The business uses both wired and wireless networking. A Linksys WRT300N wirele
    13·1 answer
  • How do you know if your phone has a virus?
    13·1 answer
  • Give me 3 facts and 3 opinions
    5·1 answer
  • 7.) Title text boxes on every slide must be the same format. <br> A. True <br> B. False
    15·2 answers
  • ساعدوني على الإجابة على هذه الأسئلة
    11·1 answer
  • How do you open an application on the macOS?
    11·2 answers
  • A financially stable person is able to:
    8·1 answer
  • Describe four traditional tehniques for collecting information during analysis.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!