I want to take inputs from console and use the numbers in performing calculations. I want to stop receiving items into array when i receive some ref value like"10"(in this case) from console. As soon as i enter 10 in console the array has to be ended and the values in array have to be multiplied. I have tried this as a program but am getting 0 as answer for the product being performed.

```
     public class Scrap {
    private static int i;
    private static double[] as;

    public static void main(String[] args) 
    {
        as=new double[100];
        for(i=0;i<as.length;i++)
        {

            as[i]=dscan();
            if(as[i]==10)
                break;
        }
        double d=1;
        for(i=0;i<as.length;i++)
        {

            d=d*as[i];
        }
        System.out.println("Product is :"+(d/10));
    }

    public static double dscan()
    {
    System.out.print(" : ");
    return new Scanner(System.in).nextDouble();
    }   

}

```