Monday, 5 September 2011

Integer Array Testing in java

import java.io.BufferedReader;
import java.io.InputStreamReader;


public class IntegerArrayTesting
{
    public static void main(String[] args) throws Exception
    {
        int arr[]=new int[3];
        int x;
       
        BufferedReader buffer = new BufferedReader(new InputStreamReader(System.in));
       
        System.out.println("Enter Values\n");
       
        for(x=0; x<3; x++)
        {
            arr[x] = Integer.parseInt(buffer.readLine());
        }
       
        System.out.println("Display Values\n");
       
        for(x=0; x<3; x++)
        {
            System.out.println(arr[x]);
        }
    }
}

No comments:

Post a Comment

Note: only a member of this blog may post a comment.