Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

import java.util.

Scanner;
public class Main
{
public static void main(String[] args)
{
Scanner sc=new Scanner(System.in);
int m[]=new int[30];
System.out.println("Enter 30 Different Numbers");
for(int a=0;a<m.length;a++)
{
m[a]=sc.nextInt();
}
for(int a=0;a<m.length-1;a++)
{
for(int b=0;b<m.length-1;b++)
{
if(m[b]<m[b+1])
{
int t=m[b];
m[b]=m[b+1];
m[b+1]=t;
}
}
}
System.out.println("Numbers arranged in descending order =");
for(int c=0;c<m.length;c++)
{
System.out.println(m[c]);
}
}
}

You might also like