title: Find the nth smallest number
body: <p>Here is my code </p>
  
  <pre><code>import java.util.Scanner;
  
  public class NthSmallest{
    public static void main (String [] args){
      Scanner input = new Scanner(System.in);
      System.out.println("Please enter the size of the array");
  
      final int N = 15;
      int n  = input.nextInt();
  
      int array[]  = new int [N];
      System.out.println("enter 15 number ");
  
      for (int i = 0 ; i &lt; array.length; i++ ) {
        array[i] = input.nextInt();
      }
  
      System.out.println(findNthSmallest(array, n  ));
    }
  
    public static int findNthSmallest( int array[], int n  ){
      int i, j,t=0;
      for(i = 0; i &lt; n; i++){
        for(j = 1; j &lt; (n-i); j++){
          if(array[j-1] &gt; array[j]){
            t = array[j-1];
            array[j-1]=array[j];
            array[j]=t;
          }
        }
      }
  
      return array[n-1];
    }
  }
  </code></pre>
  
  <p>When I want to find <code>fifthSmallestNumber</code> and enter 5 as the first input, the program finds the number five not fifth smallest number. How can I fix it?</p>