title: how can i determine all prime numbers smaller than a given input value?
body: <p>Can anyone help me to determine all prime numbers smaller than a given input value using scanner with java8 .</p>
  <blockquote>
  <p>Input: N integer&gt; 0</p>
  <p>Output: the table with prime numbers.</p>
  <p>Example: for N = 10 the Output is : 2 3 5 7</p>
  </blockquote>
  <p>this is my work so far:</p>
  <pre><code>class Main {
  public static void main(String[] args) {
      int N;
      int[] result = null;
  
      try (Scanner scanner = new Scanner(new File(args[0]))) {
          N = Integer.parseInt(scanner.nextLine());
           
            for (int i = 0; i &lt; (N/2)+1; i++) {
              if (N%i==0)
                  result[i]=i;
          for (int j = 0; j &lt; result.length; j++) {
              System.out.print(result[j]);
              if (j &lt; result.length - 1) {
                  System.out.print(&quot; &quot;);
              }
          }
          }
          System.out.println();
      }
      catch (FileNotFoundException ex) {
          throw new RuntimeException(ex);
      }
   }
  }
  </code></pre>