title: Ascending order and Descending Java
body: <p>Hi here's my problem i cant seem to print my outputs correctly i guess i'm having a logical error in my code, it doesn't print when i put an ascending number then a descending. i'm kind of new to programming too.
   Code:</p>
  
  <pre><code> import java.util.Scanner;
      public class tester {
          public static void main(String[] args) {
              int n, i, k, j;
              int asc = 0, 
              Scanner x = new Scanner(System.in);
  
              do {
  
                  System.out.print("How many numbers to process : ");
                  k = x.nextInt(); 
  
                  if(k&lt;=1) {
                      System.out.println("Enter a number greater than 1");
                  }
              } while(k&lt;=1);
  
              System.out.printf("Please enter %d numbers: ",k);
              n = x.nextInt();  
  
              for(i=0; i&lt;n-1; i++) { 
                  j = x.nextInt();
                  if( j &lt; n) { 
                      asc++;              // is this right?
                  } else {
                      asc--;
                  }
              }
              if (asc==k) {
                  System.out.print("Not Growing Up."); 
              } 
              if (asc!=k) { 
                  System.out.print("Growing Up.");
              }
          }   
     }
  </code></pre>
  
  <p>Here are the outputs     </p>
  
  <pre><code> Example outputs (what i'm trying to get)
   How many numbers to process : 4
   Please enter 4 numbers : 1 2 3 4
   Growing up.
  
   How many numbers to process : 4
   Please enter 4 numbers : 4 3 2 1
   Not Growing up.
  </code></pre>
  
  <p>This is my problem : </p>
  
  <pre><code> How many numbers to process : 4
   Please enter 4 numbers : 1 2 1 3
   Growing up.         // it should be not growing up.
  </code></pre>