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

Decision making and branching - c# program, Decision Making and Branching -...

Decision Making and Branching - C# Program Need Programming help on Decision Making and Branching in C#.

Determining salvage value of an item - c# program, Determining salvage valu...

Determining salvage value of an item - C# Program I am a learner of C# language and i am struggling with the programming functions in c#. Can you have any code examples for th

Create and populate a checkboxlist control, Ask question #Minimum 100 words...

Ask question #Minimum 100 words accepWrite an ASP.NET program that allows you to create and populate a CheckBoxList control by accessing the Title field from the Movies database ta

Class in dot net, What is a Class in dot Net? The class describes all t...

What is a Class in dot Net? The class describes all the attributes of objects, as well as the methods which implement the behavior of member objects. It is a comprehensive data

What are assemblies, What are Assemblies? Assembly is a single deployab...

What are Assemblies? Assembly is a single deployable unit that have information about the implementation of classes, structures and interfaces. It also keeps the information ab

What is reflection, What is Reflection?  It extends the advantages of m...

What is Reflection?  It extends the advantages of metadata by allowing developers to inspect and use it at runtime. For example, dynamically determine all the classes contained

Grid view, to design a grid view and edit and delete the data

to design a grid view and edit and delete the data

Develop a hotel booking wholesale system, Develop a Hotel Booking Wholesale...

Develop a Hotel Booking Wholesale System Project Description: This project is about to prepare a hotel wholesale system for B2B offering travel agents and affiliate websites

Wp7 get data from public api with xml or json, WP7 get data from public API...

WP7 get data from public API with XML or JSON Project Description: Hello, I'm seeking someone who knows his way around using an API with XML or JSON output in a windows phone

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