
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
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
Find Largest Element from an Array in C#
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
Advertisements