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

Assignment Help:

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.


Related Discussions:- Finding largest array element - c# program

Unhandled exception occurred during the execution, Project Description: ...

Project Description: I have a site that's previously fully developed, and need to fix some small problems (Text editor posting error, and a Server error caused by some Nhibernat

Application that tracks production costuming, The costumer is an applicatio...

The costumer is an application that tracks production costuming, structure and other related pieces. We discussed this in detail and you have commentary and video to define the pro

Audio expert in c# required and generate audio engine, Audio Expert in C# R...

Audio Expert in C# Required - Generate Audio Engine, Exciting Project! Project Description: We need an EXPERT CODER to help us create an 'audio engine' in C#. We need to b

How can you simple-bind controls at design mode, Question: (a) How can...

Question: (a) How can you simple-bind controls at design mode? (b) How can a blank record be created in a dataset bound to the controls in a Windows form? (c) Datagrid

Explain the concept of web services in brief, Explain the concept of Web se...

Explain the concept of Web services in brief. A Web service may be explained as an independent and self-sustained unit of a software application that is hosted on the Web and i

Define cts, CTS(Common Type System) : In order that the two language commu...

CTS(Common Type System) : In order that the two language communicate smoothly CLR has CTS (Common Type System). Example in VB you have "Integer" and in C++ you have "long" these d

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

Wds and mdt deployment server training, WDS and MDT Deployment Server Train...

WDS and MDT Deployment Server Training Project Description: I'm seeking someone who can Teach/Train me with MDT and WDS server. This Can be online teaching courses. I will

Document type definition (dtd), What is DTD? The Document Type definiti...

What is DTD? The Document Type definition (DTD) defines how your XML should structure. For illustrate in the above XML we want to make it compulsory to provide "qty" and "total

Types of compatibility in vb6, What are types of compatibility in VB6 T...

What are types of compatibility in VB6 There are three possible project compatibility settings: No Compatibility Project Compatibility Binary Compatibility

Aana

2/12/2013 1:05:57 AM

This program will help you, try it out

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

 }  

  // 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];

   }

  }

   return(temp);

 }

}

Alice

2/12/2013 1:07:39 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.

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