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
Sometimes we write similar letters to different people. For example, you might write to your parents to tell them about your cla
OleMash [197]

?

?????????????????????

4 0
3 years ago
HELP<br> When differentiating data, the WHAT of the data is:
Anna007 [38]

Answer:

a source and a target.

Explanation:

In computer science and information theory, data differencing or differential compression is producing a technical description of the difference between two sets of data – a source and a target.

7 0
1 year ago
What is another name for “low-angle lighting”?
Sliva [168]
Another name for low-angle lighting is under-lighting.
4 0
3 years ago
Does anybody know how to unlock websites from school computer
Grace [21]

Answer:

yes go to settings then apps

Explanation:

that's how I did mines

8 0
2 years ago
Chat messages are most likely to be found where on a computer? firewall nic internet history ram
miv72 [106K]
<span>The answer is RAM.  Chat messages are most likely to be found in the RAM of the computer.  It is Random Access Memory.  </span><span>RAM is considered volatile memory, which means that the stored information is lost when there is no more power.</span>
3 0
2 years ago
Other questions:
  • convert the following c code to mips. assume the address of base array is associated with $s0, n is associated with $s1, positio
    14·1 answer
  • A(n ____ with a drop down menu provides consistency in function and appearance making it easy for users to learn and work with t
    7·1 answer
  • How do media and networks interact
    11·1 answer
  • Cuales Son las características de la máquina analítica de Carlos Babbage ?
    11·1 answer
  • Which ergonomic principle helps to maintain good posture?
    8·2 answers
  • Assume you have an Access database with five different tables, including various pieces of information about your client base. Y
    9·1 answer
  • Tradegy deals with _____
    14·1 answer
  • Plzzz help i need this today :(
    15·1 answer
  • I am making a project i have to advertise a product i picked a futureistic car
    10·1 answer
  • When using MakeCode Arcade, what is the easiest way to make modules?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!