WHAT'S NEW?
Loading...

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]);
        }
    }
}

0 comments:

Post a Comment