

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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 Questions & Answers
- Python Program to find the largest element in an array
- C# Program to find the largest element from an array using Lambda Expressions
- C++ Program to Find Largest Element of an Array
- Python Program to find largest element in an 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
- 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
- Program to find out the index in an array where the largest element is situated in Python
- C# Program to find the smallest element from an array using Lambda Expressions
- Java program to find Largest, Smallest, Second Largest, Second Smallest in an array
- Find largest element from array without using conditional operator in C++
- C# program to get the last element from an array
Advertisements