- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- 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 smallest element from an array using Lambda Expressions
Declare an array −
int[] arr = { 10, 15, 5, 20};
Now to get the smallest element from an array, use Min() method with lambda expressions −
arr.Min());
Here is the complete code −
Example
using System; using System.Linq; class Demo { static void Main() { int[] arr = { 10, 15, 5, 20}; Console.WriteLine(arr.Min(element => Math.Abs(element))); } }
Output
5
- Related Articles
- C# Program to find the largest element from an array using Lambda Expressions
- C# Program to find the smallest element from an array
- C# Program to find the longest string from an array of strings using Lambda Expression
- C# Program to find the largest element from an array
- Swift Program to Find Smallest Array Element
- Program to get the last element from an array using C#
- Java Program to get the reverse of an Integer array with Lambda Expressions
- C# program to find K’th smallest element in a 2D array
- C++ Program to find kth Smallest Element by the Method of Partitioning the Array
- C# program to get the last element from an array
- C# Program to display the first element from an array
- Program to find out the k-th smallest difference between all element pairs in an array in C++
- C++ Program to Find Minimum Element in an Array using Linear Search
- C++ Program to Find Maximum Element in an Array using Binary Search
- Find the Smallest element from a string array in JavaScript

Advertisements