Calculate Sum and Average of an Array in C# – Programming, Pseudocode Example, C# Programming Example
Arrays C# Console For Loop

Calculate Sum and Average of an Array in C#

In this article, We will see two programs to find the average of numbers using array. First Program finds the average of specified array elements. The second programs takes the value of n (number of elements) and the numbers provided by user and finds the average of them using array.

Example 1: Program to find the average of numbers using array

C# Code:

Output:

Example 2: Calculate average of numbers entered by user

In this example, we are using Scanner to get the value of n and all the numbers from user.

C# Code:

Output:

1 Comment

  • Wow!!!!!!!!!!!!!!! Thank you so much for this.
    It really rescued me with my assignment, you are the best. I will always come to this website!

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.