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

Facebook fan page poster or program, Project Description: Program or Fan...

Project Description: Program or Fan Page Poster for facebook fan pages. Major task of this program would be posting pictures on your facebook fan page from other users fan pa

Six sigma, What is SIX sigma? The Sigma means the deviation in Greek la...

What is SIX sigma? The Sigma means the deviation in Greek language. The Deviation means how much variations exist in a set of data. For illustrate  let's say in a software main

Develop shop and veterinarian online, Among the items that are related to t...

Among the items that are related to the implementation of an application for automation of processes, are shown as follows: a) The online patient registry through which patients

Looking to build fifa coins selling and buying website, Looking to build FI...

Looking to build FIFA coins selling and buying website Project Description: I would like a website made for FIFA 14 TEAM. What this website will do is having automatically bu

XML, Write a XML with database with book details (BOOK ID, Title, Author, s...

Write a XML with database with book details (BOOK ID, Title, Author, subject, published Year, language, vendor, price)

Do webservice have state?, Webservices as such do not have any mechanism by...

Webservices as such do not have any mechanism by which they can maintain their state. The Webservices can access ASP.NET intrinsic objects such as application, session and many mor

What is different overloading and overriding, What is different overloading...

What is different overloading and overriding, please explain

Unlock software or make similar one, Project Description: I need to unlo...

Project Description: I need to unlock software or make a similar kind of software. It is presently installed in my PC and I will provide you installation files if needed. It wil

Write the basic syntax of a linq query in visual basic, Write the basic syn...

Write the basic syntax of a LINQ query in Visual Basic as well as in C#. In Visual Basic, the basic syntax of a LINQ query begins with the from clause and ends with the Select

Service oriented architecture, What is Service Oriented architecture? T...

What is Service Oriented architecture? The "Services" are the components which expose well defined interfaces and these interfaces communicate through XML messages. By Using th

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