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

Prepare datamodel, Prepare datamodel, API and more Project Description: ...

Prepare datamodel, API and more Project Description: Dear all, we would like you to prepare database and an API which can be used in the shopping cart (checkout and delivery

What is the use of dataview, What is the use of DataView? User-defined ...

What is the use of DataView? User-defined view of a table is contained in a DataView. A complete table or a small section of table depending on some criteria can be shown by an

Describe the architecture of the .net framework, Question: (a) What is...

Question: (a) What is VB.NET 2005 and explain the versions of VB.NET. Name the four different types of applications that new version of VB.NET can create. (b) Using the

Determine .net framework, What is .NET Framework? .NET Framework is a c...

What is .NET Framework? .NET Framework is a complete environment that permits developers to develop, run, and deploy the following applications:     Windows services

Use of connection object, What is the use of connection object? The con...

What is the use of connection object? The connection objects are used to connect a data to the Command object. 1)An OleDbConnection object is used with the  OLE-DB provider

Develop outlook add-in for all versions, Develop Outlook Add-In for all ver...

Develop Outlook Add-In for all versions I need simple code for Outlook(express,2003,2007,2010,2013) Add-In with functionality to repeatedly send CC to the specified email(s), th

Use of "must inherit" keyword in vb.net, What is the use of "Must Inherit" ...

What is the use of "Must Inherit" keyword in VB.NET? If you want to create an abstract class in the VB.NET it is done by using the "MustInherit" keyword.You can't create an obj

What is an activity, What is an activity? In Windows Workflow Foundatio...

What is an activity? In Windows Workflow Foundation 4.0, an activity is the basic unit of composition and implementation of a workflow. Each activity in a workflow consists of

Specify session state mode in asp.net, cookieless="false" timeout="20" ...

cookieless="false" timeout="20" /> Above is sample session state mode specified for SQL SERVER.

Asp.net 2.0 application port to asp.net mvc, Project Description: Legacy...

Project Description: Legacy ASP.NET application for managing tasks for a private client needs a complete re-write. The application has approximately 2500 lines of code, combi

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