Sum and Average of Array in Java

Sum and Average of Array in Java

Here, you will get the program code to calculate the Sum and Average of array in Java programming.

To calculate sum and average, we will get some n numbers from the user, store in an int Array, and after that calculate the Sum and Average of Array Elements and print the result.

Sum :-

Sum is the total of all the given numbers.

Average : –

Average is the mean value of all given numbers. Formula of average is following:

Average = Sum of all Values / Number of All values

Sum and Average of Array in Java Example

Output

sum and average of array in java

 

 

 

Check out our other Java Programming Examples

 

 

 

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top