Hi, My child is appearing for class x exams and is having difficulty with java programming. Is writing different programs but is having difficulty understanding where is going wrong. Can someone please look at this code to sort 15 numbers in descending order using selection sort
//program to accept 15 numbers and print them in descending order using selection sort
import java.io.*;
public class sort
{
public static void main(String[]args)throws IOException
{
BufferedReader userin= new BufferedReader(new InputStreamReader(System.in));
int i;int j;int pos;int max;int t; //
int n[]=new int[15];
for(i=0;i<15;i++)
{
System.out.println("Enter a number");
n[i]=Integer.parseInt(userin.readLine());
}
for(i=0;i<14;i++);
{
max=n[i];
pos=i;
for(j=i+1;j<15;j++);
{
if(n[i] < n[j])
n[j]=max;
pos=j;
}
}
t=n[i];
n[i]=n[pos];
n[pos]=t;
for(i=0;i<15;i++)
{
System.out.println(n[i]);
}
}
}