title: Java, adding arrays
body: <p>i am working on a program to add numbers using an array. I have completed a lot of it but am troubled at the last part adding the actual numbers in the code. Here is my code.</p>
  
  <pre><code>public static void main (String[] args) {
      Scanner input= new Scanner(System.in);
      System.out.println("Enter size of array");
      int n= input.nextInt();
      int[] x= new int[n];
      System.out.println("Enter Array nums");
      for(int i=0;i&lt;n;i++){
          x[i]= input.nextInt(); 
      }
  }
  </code></pre>