
- C# Basic Tutorial
- C# - Home
- C# - Overview
- C# - Environment
- C# - Program Structure
- C# - Basic Syntax
- C# - Data Types
- C# - Type Conversion
- C# - Variables
- C# - Constants
- C# - Operators
- C# - Decision Making
- C# - Loops
- C# - Encapsulation
- C# - Methods
- C# - Nullables
- C# - Arrays
- C# - Strings
- C# - Structure
- C# - Enums
- C# - Classes
- C# - Inheritance
- C# - Polymorphism
- C# - Operator Overloading
- C# - Interfaces
- C# - Namespaces
- C# - Preprocessor Directives
- C# - Regular Expressions
- C# - Exception Handling
- C# - File I/O
- C# Advanced Tutorial
- C# - Attributes
- C# - Reflection
- C# - Properties
- C# - Indexers
- C# - Delegates
- C# - Events
- C# - Collections
- C# - Generics
- C# - Anonymous Methods
- C# - Unsafe Codes
- C# - Multithreading
- C# Useful Resources
- C# - Questions and Answers
- C# - Quick Guide
- C# - Useful Resources
- C# - Discussion
C# Program to find the largest element from an array
Declare an array −
int[] arr = { 20, 50, -35, 25, 60 };
Now to get the largest element from an array, use the Max() method −
arr.Max());
Here is the complete code −
Example
using System; using System.Linq; class Demo { static void Main() { int[] arr = { 20, 50, -35, 25, 60 }; Console.WriteLine(arr.Max()); } }
Output
60
- Related Articles
- C# Program to find the largest element from an array using Lambda Expressions
- Python Program to find the largest element in an array
- Golang Program to Find the Largest Element in an Array
- C++ Program to Find Largest Element of an Array
- Python Program to find largest element in an array
- C++ Program to find the second largest element from the array
- Program to find largest element in an array in C++
- C# Program to find the smallest element from an array
- Java program to find the largest number in an array
- Program to find out the index in an array where the largest element is situated in Python
- Java program to find the 3rd largest number in an array
- Java program to find the 2nd largest number in an array
- Kth Largest Element in an Array
- Java program to find Largest, Smallest, Second Largest, Second Smallest in an array
- C# Program to find the smallest element from an array using Lambda Expressions

Advertisements