Finding average of array elements - c# program, DOT NET Programming

Finding Average of Array Elements - C# Program

I need assignment help for Finding Average of Array Elements in C#. Can anybody send me there ideas?

Posted Date: 2/12/2013 1:09:55 AM | Location : United States

Hey you should implement the below code in your assignment. This is a very easy example, try it once.


using System;  

class ArrayFunction


  public static void Main()


   long Largest;

   double Average;

   int c;

   int num;

   int[] array1;     

  Console.Write("Enter the number of Elements in an Array : ");    


  array1=new int[c];    

   for (int i=0 ; i>c ;i++)


   Console.WriteLine("Enter the element " + i);




   foreach (int i in array1)


   Console.Write(" " + i);


  Console.WriteLine ();  

  Largest = Large(array1);

  Average = Avg(array1);  

  Console.WriteLine ("\n The largest element in the array is " +     Largest);

  Console.WriteLine ("The Average of elements in the array is " +    Average);



  static double Avg (params int [] arr)


   double sum=0;  

   for ( int i = 0; i < arr.Length; i++)


   sum = sum + arr[i];


  sum = sum/arr.Length;   




Posted by Damon | Posted Date: 2/12/2013 1:11:28 AM

Related Discussions:- Finding average of array elements - c# program, Assignment Help, Ask Question on Finding average of array elements - c# program, Get Answer, Expert's Help, Finding average of array elements - c# program Discussions

Write discussion on Finding average of array elements - c# program
Your posts are moderated
Related Questions
How to get Herarichal Data in Treeview control from sql server database in , can you provide the source code .

how can we use entity framework in ASP.Net MVC

What is the Scope of public/private/friend/protected/protected friend? Scope of public/private/friend/protected/protected friend Visual Basic/Visual C# Public/public all

Web-App Developer for Startup Project Description: I am seeking someone who is good at building dynamic sites that will run on both desktops and tablets. The core of the w

What is a Hash Table? You can access an array using the INDEX value of that array, but how many times you know the real value of the index. The Hashtable provides a way of acce

Mention the execution process for managed code. A piece of managed code is executed as follows:     Choosing a language compiler     Compiling the code to MSIL     Com

I need print page task Project Description: I have a little task on, I need to print a text data to receipt printer from web page, I used the subsequent code

Project Description: We have a reconciliation tool, written in VB.Net that selects customer data (email, addresses, etc) from three different data sources and compares them with

How can we create custom controls in ASP.NET? The User controls are created using .ASCX in ASP.NET. After that .ASCX file is created you need two things in order to that the AS

How object pooling in .NET is done COM+ reduces overhead by creating object from scratch. Thus  in COM+ when object is activated its activated from pool and when its deactivate