Finding largest array element - c# program, DOT NET Programming

Finding Largest Array Element - C# Program

I am unable to make out the Largest Array Element in C# language. Can anyone suggest me any example for this.

Posted Date: 2/12/2013 1:03:20 AM | Location : United States

This program will help you, try it out


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



  // Determining the largest array element   static int Large (params int [] arr)


   int temp=0;  

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


    if (temp <= arr[i])


    temp = arr[i];






Posted by Aana | Posted Date: 2/12/2013 1:05:57 AM

As a C# beginner, this is the first time out of at least three previous tried ?that, I can finally understand how can i Find largest array element. Thank You so much.

Posted by Alice | Posted Date: 2/12/2013 1:07:39 AM

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

Write discussion on Finding largest array element - c# program
Your posts are moderated
Related Questions
What are advantages of SQL 2000 over SQl 7.0? 1)User-Defined Functions: The User-Defined Functions (UDFs) -- one or moreTransact-SQL statements may be used to encapsulate the

Project Description: College erp Erp key features: Panacea ERP Online Suite is server based college based management software. Gives Password facility for different use

I have a website with a photo gallery using PhotoHandler I require the code added/ modified to display the image file names under the preview or thumbnai

What is the difference between System exceptions and Application exceptions? All exception is derived from Exception Base class. Exceptions are generated programmatically or ca

What is a DataReader object? The DataReader object helps in retrieving the data from a database in a forward-only, read-only mode. The base class for all the DataReader objects

What is Query String and what are their benefits and limitations? The query string is the information sent to the server appended to the end of a page URL. The benefits of u

TASK - DESIGN ALGORITHM You are required to design a suitable solution algorithm by using either structured chart, pseudocode or flowchart. This diagram should clarify the proce

What are events? As compared to the delegates events works with source and listener methodology. So the listeners who are interested in receiving few events they subscribe to t

What is ASP.NET Authentication Providers and IIS Security? ASP.NET executes authentication using authentication providers, which are code modules that determine credentials and

We would like you to develop the subsequent requirements in one plug-in already in production. The plug-in was developed in Visual Studio 2010 .NET Framework 4 C# and synchronizes