 
  Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP 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
Declare an array −
int[] arr = { 5, 9, 2, 7 }; Now to get the smallest element from an array, use the Min() method −
arr.Min());
Here is the complete code −
Example
using System; using System.Linq; class Demo {    static void Main() {       int[] arr = { 5, 9, 2, 7 };       Console.WriteLine(arr.Min());    } }  Output
2
Advertisements
 