answersLogoWhite

0

import java.io.*;

public class descendingorder

{

public static void main(String args[]) throws IOException

{

BufferedReader in= new BufferedReader(new InputStreamReader(System.in));

int i,j,n,t;

int a[]=new int[20];

System.out.println("Enter the number of elements:");

n=Integer.parseInt(in.readLine());

System.out.println("Enter the elements of the array:");

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

{

a[i]=Integer.parseInt(in.readLine());

}

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

{

for(j=0;j<n;j++)

{

if(a[i]>a[j])

{

t=a[i];

a[i]=a[j];

a[j]=t;

]

}

}

System.out.println("The orderer lit...");

{

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

{

System.out.println(a[i]);

}

}

}

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

How do you arrange words in cline and examples?

its arranged by ascending and descending order.........


Which way is ascending and descending?

Ascending means increasing in value or moving higher, while descending means decreasing in value or moving lower. In a numeric sequence, ascending would go from lowest to highest, while descending would go from highest to lowest.


How do you sort data in a database?

To sort is to arrange a field(column) depending on whether you choose to have them from lowest to highest or from highest to lowest (ascending or descending)


Output for ascending order and descending order?

Example 7, 30, 11, 27, 9, 16,Ascending Order = 7, 9, 11, 16, 27, 30 ( You simply arrange the number from lowest to highest number )Descending Order = 30, 27, 16, 11, 9, 7 ( You simply arrange the number from highest to lowest number )


Draw a flowchart to arrange 3 numbers in ascending order?

draw a flow chart to arrange 3 numbers in ascending order


What is it called to arrange in order from greastest to least?

descending


To arrange data in a desired order?

# You can sort data in ascending order depending on the desired requirements # You can also sort data in descending order depending on the application package your using 2b hb 3b b h 3h


How do you arrange 4 numbers in ascending order without array?

addends


How can the keyword "sorting" be implemented in pseudo code to arrange the elements of an array a of integers in ascending order?

To implement the keyword &quot;sorting&quot; in pseudo code to arrange the elements of an array a of integers in ascending order, you can use the following algorithm: Start by iterating through the array a from the first element to the second-to-last element. Compare each element with the next element in the array. If the current element is greater than the next element, swap their positions. Continue this process until the entire array is sorted in ascending order. Here is a simple example of pseudo code for implementing the sorting algorithm: for i from 0 to length(a) - 1 do for j from 0 to length(a) - i - 1 do if aj aj 1 then swap(aj, aj 1) end if end for end for This pseudo code represents a basic implementation of a sorting algorithm to arrange the elements of an array in ascending order.


In Microsoft Excel sorting can be used to arrange data in?

Things can be put alphabetical order, numerical Order, date order and so on. Things can be put in ascending or descending order. You can also say that it arranges data in columns, if you take another perspective on your question.


If you arrange all the one digit odd numbers in ascending order and then in descending order to form five digit numbers what digit occupies the same place value?

this question is not soluble.the information given reduces the no. of candidates from 9999 to 900 but cant get closer than that


What will be the program to arrange numbers stored in array in ascending order using pointers?

sorry