Find Sum and Average of Array Elements in C

Find Sum and Average of Array Elements

In this example code, you will learn to find Sum and Average of Array Elements in C programming. Follow the following steps to complete the program:-

Step 1 Create an array list by input some numbers.

Step 2 add all the numbers in a variable.

Step 3 get average by the following formula

Average = sum of all elements / total number of elements.

Step 4 Print the Average, as result.

Program to Find Sum and Average of Array Elements in C

Output

Enter 5 Numbers  :  2 5 4 7 12
Sum of 5 numbers is : 30
Average of 5 numbers is : 6

Check out our other C programming Examples

Leave a Comment

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

Scroll to Top