Write a program, using C#, that will find the mean and standard deviation of a number of data points. The program should allow the user to enter data manually or via a text file.
using System;
public class HelloWorld
{
// Main method which starts the program execution.
public static void Main()
{
int n;
float deviation, sum, sumsqr, mean, variance, stddev;
Console.Write("Enter number of elements:");
n = int.Parse(Console.ReadLine());
float[] num = new float[n];
sum = 0;
sumsqr = 0;
/* Reading array elements */
Console.WriteLine("Input " + n + " values");
for (int i = 0; i < n; i++)
{
num[i] = float.Parse(Console.ReadLine());
sum += num[i];
}
mean = sum / (float)n;
Console.WriteLine("Mean is "+ mean);
for (int i = 0; i < n; i++)
{
deviation = num[i] - mean;
sumsqr += deviation * deviation;
}
/* variance */
variance = sumsqr / (float)n;
stddev = (float)Math.Sqrt(variance);
Console.WriteLine("Standard Deviation is " + stddev);
Console.WriteLine("Variance is " + variance);
Console.ReadKey();
}
}

if you have any doubts please ping me in
the comment section below,thank you
Write a program, using C#, that will find the mean and standard deviation of a number...