title: Find a maximum and minimum value using for loop
body: <p>I am trying to take 10 integers from the user's input and find the minimum and maximum using for loop. But my final print statement just prints the list of numbers entered. I'm lost.</p>
  
  <pre><code>public static void main(String[]args) {
  
     Scanner scan=new Scanner(System.in);
     double a = 0;
     double max = 0;
     double min = 0;
  
     System.out.print("Enter ten floating points: \n");
  
     for(a=0; a &lt;10; a++) {
        a=scan.nextDouble();
  
         if(a == 0) { 
             min=a;
             max=a; 
         } 
         else if(a &lt; min) {
             min=a; 
         }
         else if (a &gt; max){ 
             max=a; 
         }
     }
     System.out.println("Minimum value: " +min);
     System.out.println("Maximum value: " +max);
  }
  </code></pre>