
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.

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