chandru
Quries
1 Answer(s)      a year and 9 months ago
Posted in : Java Beginners

a JAVA program to create an array of size 10 (Integer Values) by taking input from BufferReader and find out the average value of array elements from that array.

View Answers

August 4, 2011 at 11:01 AM


import java.io.*;
class  ArrayExample{
    public static void main(String[] args)throws Exception{
        int sum=0;

        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        System.out.println("Enter Array Elements: ");
        int array[]=new int[10];
        for(int i=0;i<array.length;i++){
            array[i]=Integer.parseInt(br.readLine());
        sum+=array[i];
        }
        System.out.println("Sum Of Array Elements is: "+sum);
        System.out.println("Average of Array Elements is: "+(double)sum/array.length);
        }
}









Related Pages:
sql quries
sql quries  i want basic sql quries please provide
CHECK WHICH NO IS GREATER IN 4 NO'S
chaudhary(+919261377137) if you want to ask any quries then contact me or email

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.