Java Program to calculate the average in an array element using for loop.

Output: