Hi friends, I am going to write a simple program to calculate the average for the set of values. It is easy to calculate the average of numbers, to find the average of numbers just add up all the numbers, then divide by how many numbers there are. In other words, it is the sum divided by the count.

## C# Program to calculate the average for the set of values:

```using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Text;
using System.Runtime.Serialization.Json;
namespace CheckPrimeUsingRecursion
{
class Program
{

static void Main(string[] args)
{

int iNumberofItem, iCount, iSum = 0, iAverage = 0;
Console.WriteLine("Enter the Number of Items in the Array ");
int[] arrItem = new int[iNumberofItem];
Console.WriteLine("Enter the Array Elements ");
for (iCount = 0; iCount < iNumberofItem; iCount++)
{
}
for (iCount = 0; iCount < iNumberofItem; iCount++)
{
iSum += arrItem[iCount];
}
iAverage = iSum / iNumberofItem;
Console.WriteLine("Average is {0}", iAverage);

}

}
}```

## Output:

```Enter the Number of Items in the Array
4
Enter the Array Elements
6
4
6
7
Average is 5```

## View More:

### Conclusion:

I hope you would love this post. I would appreciate your suggestions and feedback. Please don’t hesitate to comment for any technical help.

### Explore post tags

Warning: mysqli_num_fields() expects parameter 1 to be mysqli_result, bool given in C:\inetpub\vhosts\debugonweb.com\httpdocs\wp-includes\wp-db.php on line 3353