Search This Blog

Monday, September 3, 2012

To accept 10 decimal values from the user on Terminal Window

import java.io.*;
public class yps
{
    public static void main(String args[]) throws IOException
    {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        double num[]=new double[10];
        int i;
        System.out.println("Enter 10 decimal values");
        for(i=0; i<10; i++)
        {
            num[i]=Double.parseDouble(br.readLine());
        }
        System.out.println("The 10 decimal values entered are:");
       for(i=0; i<10; i++)
        {
            System.out.println(num[i]);
        }
    }
}

2 comments:

  1. maam there is 1 with parameters also.

    ReplyDelete
  2. thank u didi!!!!it has helped us a lot.

    ReplyDelete