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
andreyandreev [35.5K]
3 years ago
5

Write a program that gets a list of integers from input, and outputs the integers in ascending order (lowest to highest). The fi

rst integer indicates how many numbers are in the list. Assume that the list will always contain less than 20 integers.Ex: If the input is 5 10 4 39 12 2, the output is: 2 4 10 12 39Your program must define and call the following method. When the SortArray method is complete, the array passed in as the parameter should be sorted.
Computers and Technology
1 answer:
Travka [436]3 years ago
5 0

Answer:

Explanation:

Since no programming language is stated, I'll use Microsoft Visual C# in answering this question.

// C# program sort an array in ascending order

using System;

class SortingArray {

int n; //number of array elements

int [] numbers; //Array declaration

public static void Main() {

n = Convert.ToInt32(Console.ReadLine());

numbers = new int[n];

for(int i = 0; i<n; I++)

{

numbers [n] = Convert.ToInt32(Console.ReadLine());

}

SortArray();

foreach(int value in numbers)

{

Console.Write(value + " ");

}

}

void SortArray()

{

int temp;

// traverse 0 to array length

for (int i = 0; i < numbers.Length - 1; i++)

// traverse i+1 to array length

for (int j = i + 1; j < numbers.Length; j++){

// compare array element with all next element

if (numbers[i] < numbers[j])

{

temp = numbers[i];

numbers[i] = numbers[j];

numbers[j] = temp;

}

}

}

You might be interested in
Climatologist use weather balloons, stethoscopes, and satellites true or false
Nonamiya [84]

Answer:

False.

Explanation:

A stethoscope is a medical instrument which is used for listening to the work of the heart and lungs.  It consists of a microphone that rests on the patient's chest, and rubber tubes that bring the sound to the earphones. An ordinary stethoscope does not have any moving or electrical parts, as it only mechanically conducts sound from the patient's chest to the doctor's ear.   One of the simplest examinations that doctors perform today is listening to the lungs and heart with a stethoscope. With the help of this instrument, noises are heard during the work of the lungs and heart.

8 0
2 years ago
A computer can read whatever you type into it.<br> A)True<br> B)False
motikmotik

Answer:

True

Explanation:

Everything typed into a computer is saved as data and logged.

3 0
3 years ago
Read 2 more answers
Which transfer of learning occurs when the performance of a maneuver interferes with the learning of another maneuver?
Nutka1998 [239]

Answer:

Negative transfer of learning

Explanation:

Negative transfer of learning occur when the knowledge you've acquired in the past is/are interfering with the one(s) you are currently acquiring.

Example: learning a new language that have some differences in pronunciation from the previous one, changing from a right-sided vehicles to a left-sided vehicles etc.

3 0
3 years ago
What is the term for the part of a browser responsible for reading and processing programming languages?
koban [17]
The interpreter is the answer.
4 0
3 years ago
What is force? what are the types of force ? Explain all with suitable examples<br>​
ad-work [718]
Force is a push or pull which is exerted on an objects. Types of Force are

Contact forces
Non contact forces or At a distance forces

Examples of Contact forces are:
Stretching of the spring of a balance
pushing of a pram
kicking of a football
Pushing the door
Hitting the ball etc are some examples of contact forces.

some types of contact forces are given in the list below:

Applied force
Normal force
Frictional force
Tension force
Air resistance force
Spring force
6 0
3 years ago
Other questions:
  • Using the expected format, of putting key information where the reader can’t find it, is an example of?
    8·2 answers
  • You use a ____ following the closing brace of an array initialization list.
    12·2 answers
  • How to get out of compatibility mode in word?
    15·1 answer
  • A Windows application which demands a lot of raw processing power to execute repetitive complex calculations is a good candidate
    9·1 answer
  • Which of the following is a valid HTML reference to a CSS file?
    13·1 answer
  • Select the correct answer.
    10·1 answer
  • Explain each kind of pointer and for what it is appropriate
    15·2 answers
  • Is monitor is a television​
    5·2 answers
  • What is the name of the option in most presentation applications with which you can modify slide elements?
    7·2 answers
  • Can you help me with this question please ​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!