

- 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 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 Questions & Answers
- 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
- Program to get the last element from an array using C#
- Java Program to get the reverse of an Integer array with Lambda Expressions
- Find the Smallest element from a string array in JavaScript
- C++ Program to find kth Smallest Element by the Method of Partitioning the Array
- C++ program to find the smallest element among three elements
- Java program to find the smallest number in an array
- Lambda Expressions in C#
- C# Program to display the first element from an array
- C# program to get the last element from an array
- C program to find the second largest and smallest numbers in an array
- Program to find out the k-th smallest difference between all element pairs in an array in C++
Advertisements