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
What is another name for a computer on network
Georgia [21]
A computer can also be called a client or server depending on it's hardware and intended function.
4 0
4 years ago
To increase security on your company's internal network, the administrator has disabled as many ports as possible. Now, however,
tia_tia [17]

Answer: 443

Explanation:

Port 443 will need to be enabled for secure transactions to go through because it is the default port for HTTPS which is the transfer protocol for secure communication.

This way your credit card transactions will be encrypted to ensure protection from those who would seek to steal your data and your money.  

8 0
3 years ago
Select the correct answer.
snow_tiger [21]

Answer: I think it's D.

Explanation: I'm sorry if I chose the wrong answer, I'm not too good with stuff like this.

3 0
2 years ago
What is 8 hours, 5 minutes, 22 seconds minus (-) 7 hours, 24 minutes, 37 seconds?
olga_2 [115]

Answer:

Enter time 1 HH:MM:SS8:5:22                                                                                                    

Enter time 2 HH:MM:SS7:24:37                                                                                                  

0:40:45

Explanation:

The program for above in Python is:

from datetime import datetime

s1 = input("Enter time 1 HH:MM:SS")

s2 = input("Enter time 2 HH:MM:SS")

Format1 = '%H:%M:%S'

tdiff = datetime.strptime(s1, Format1) - datetime.strptime(s2, Format1)

print(tdiff)

We are using the datetime class in datetime module for using strptime to find the difference between the two times.

3 0
4 years ago
NOTE: Throughout this lab, every time a screenshot is requested, use your computer's screenshot tool, and paste each screenshot
weeeeeb [17]

Answer:

Yes.

Explanation:

8 0
4 years ago
Other questions:
  • What is data called that is input into a cryptographic algorithm for the purpose of producing encrypted data?
    14·1 answer
  • What file format is best for photo editing? Select one: a. JPG b. RAW c. DOC d. RTF
    12·2 answers
  • Why does the phrase "compatibility mode” appear when opening a workbook?
    6·2 answers
  • This short cut key combination deletes a line in most text documents.
    8·1 answer
  • Which button could Pamela press in the Microsoft Word spell checker to make the word “colour” instantly change to “color” whenev
    11·1 answer
  • "In a web app, where is data usually stored? A. Mobile network B. Application storage C. Local computer D. Cloud storage"
    14·1 answer
  • Please help,it’s a year 9 question
    7·1 answer
  • Iam trying to find a way to code in Scratch that will let me take away the first two and last two letters of a word. For example
    15·1 answer
  • Can someone please do this java lab for me (100 point version)? Im really having trouble. (DO NOT GIVE FAKE, USELESS ANSWERS. I
    14·1 answer
  • What is program used to detect and eliminate any viruses or worms trying to infect your computer
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!