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

Assignment Help:

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?


Related Discussions:- Finding average of array elements - c# program

A super-hero sharepoint developer with great design skills, A Super-hero Sh...

A Super-hero Sharepoint developer with great design skills Project Description: US: Our start-up company develops a very cool and innovative SharePoint related product with c

Connect my marketplace website with stripe/connect, Project Description: ...

Project Description: I am trying to connect my marketplace website with Stripe/connect. I have 5 or 6 scripts already written that just need to be adjusted so they will work: 2

Auto trading software for nse, Project Description: Step 1: Buy 1 sha...

Project Description: Step 1: Buy 1 share at existing market price (ex: buy 1 at 100.00) If 4 points profit then close position if not go to step 2 Step 2: if 2 point

Forms authentication, Explain Forms authentication in detail. In the ol...

Explain Forms authentication in detail. In the old ASP if you were said to create a login page and do authentication you have to do lot of custom coding. But now in ASP.NET tha

Create custom controls in asp.net, How can we create custom controls in ASP...

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

What is dynamic language runtime, What is Dynamic Language Runtime (DLR)? ...

What is Dynamic Language Runtime (DLR)? DLR is a runtime environment that permits you to integrate dynamic languages with the Common Language Runtime (CLR) by adding a set of s

Explain dataset accept changes, Explain Dataset Accept Changes and Data Ada...

Explain Dataset Accept Changes and Data Adapter Update methods?  Data Adapter Update method Calls the respective INSERT, UPDATE, or DELETE statements for each inserted, updated

Asp .net facebook app project completion, Project Description: We are a ...

Project Description: We are a small development house in Singapore, and have a project which is 90 percent complete; thud our previous developer could not finish due to other co

Common code, How do I write common code for different dot net framework dat...

How do I write common code for different dot net framework data providers?

Damon

2/12/2013 1:11:28 AM

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

Program:

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 : ");    

  c=int.Parse(Console.ReadLine());    

  array1=new int[c];    

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

  {

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

   num=int.Parse(Console.ReadLine());

   array1[i]=num;

  }  

   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);

  Console.ReadLine();       

 }  

  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;   

   return(sum);

 }

}

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd