
- 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 using Lambda Expressions
Declare an array −
int[] arr = { 10, 90, 20, 19, 99, 57 };
Now to get the largest element from an array, use Max() method with lambda expressions −
arr.Max());
Here is the complete code −
Example
using System; using System.Linq; class Demo { static void Main() { int[] arr = { 10, 90, 20, 19, 99, 57 }; Console.WriteLine(arr.Max(element => Math.Abs(element))); } }
Output
99
- Related Articles
- C# Program to find the smallest element from an array using Lambda Expressions
- C# Program to find the largest element from an array
- 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 longest string from an array of strings using Lambda Expression
- Java Program to get the reverse of an Integer array with Lambda Expressions
- Find largest element from array without using conditional operator in C++
- C# Program to find the smallest element from an array
- Program to get the last element from an array using C#
- 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

Advertisements