Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Compile and Execute C# Sharp Online

using System;  
public class ArrayExample  
{  
    static void maxArray(int[] arr)  
    {  
        int min = arr[0];
           for (int i = 1; i < arr.Length; i++) {
            
           if(min > arr[i]){
               min = arr[i];
               Console.WriteLine("Minimum element is: " + min);  
           }
       }
    }  
    public static void Main(string[] args)  
    {  
        int[] arr1 = { 25, 10, 20, 15, 40, 50 };  
        int[] arr2 = { 12, 23, 44, 11, 54 };  
        int[] arr3 = {1,2,3,4,5,6,7};
        minArray(arr1);
        minArray(arr2);
        minArray(arr3);
    }  
}

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.