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

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

What are major difference between classic ado and ado.net, What are major d...

What are major difference between classic ADO and ADO.NET? Following are some major differences among both In ADO we have recordset and in ADO.NET we have dataset. In rec

How can you implement a condition in a workflow, How can you implement a co...

How can you implement a condition in a workflow? You can implement a condition by using either of the following ways: By creating a rule condition - Specifies that you can e

Simple Harmonic Motion, How can you make a simple harmonic motion in visual...

How can you make a simple harmonic motion in visual basic 2010 where you will ask an input to the user and your output will be a moving pendulum and a graph. Also the displacement

What are the different implementations of linq, What are the different impl...

What are the different implementations of LINQ? The different implementations of LINQ are: LINQ to SQL - Refers to a component of.NET Framework version 3.5 that provides a

Describe in biref about object-oriented programming, What is object-oriente...

What is object-oriented programming (OOP)? OOP is a method to develop logical modules, such as classes that contain properties, methods, fields, and events. An object is formed

Describe the layer of the .net framework, Question: (a) Using the help...

Question: (a) Using the help of a diagram, describe the layer of the .NET framework that sits between Visual Basic.NET 2005 and the operating system. (b) Explain the charac

Describe how a user control is declared in an asp.net page, Question: (...

Question: (a) One problem encountered when designing web applications is that HTTP is a "stateless" protocol. Explain two general approaches to solve the statelessness problem

Object in dot net, What is an Object in Dot Net? This is the basic unit...

What is an Object in Dot Net? This is the basic unit of a system. An object is an entity that has identity, attributes, and behavior. The Objects are members of a class. The cl

Create a website for online sales of movies, Niles Video Inc. wants to crea...

Niles Video Inc. wants to create a website for online sales of movies (DVD and videotapes). People will be allowed to register as customers on the website and to update their store

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