About 9,590,000 results
Open links in new tab
  1. c# - Largest and smallest number in an array - Stack Overflow

    Feb 5, 2011 · int smallest = array[0]; for(int i=0;i<10;i++) if(array[i]<smallest) smallest=array[i]; int largest = array[9]; for(int i=0;i<10;i++) if (array[i] > largest) largest = array[i]; …

  2. Find smallest element from integer array in C# - Includehelp.com

    Mar 19, 2023 · In this article we will learn, how to find smallest elements from a list of integers? Given an integer array and we have to find the smallest element among all array elements.

  3. c# - Finding smallest value in array - Stack Overflow

    Sep 2, 2013 · I need to find the smallest value which is larger than 0 among all integers stored in an array. I tried some of the ways of doing that on stackoverflow, but my minimal value still …

  4. c# - Get the min value from array - Stack Overflow

    public int Min() { // array gets de value thats on 0. int Min = numbers[0]; foreach(int number in numbers) { // if the number is smaller then 0. if (number < Min) { // zero is the new number. Min …

  5. c# - Find Shortest element in Array - Stack Overflow

    Jul 3, 2011 · In C#, .Net 3.5: string shortestName = names.Aggregate((n1, n2)=>n1.Length<n2.Length?n1:n2); This is how you can store other elements in other array. …

  6. Find the smallest and second smallest elements in an array

    Mar 11, 2025 · Given an array arr[] of size N, find the smallest and second smallest element in an array. Examples: Input: arr[] = {12, 13, 1, 10, 34, 1} Output: 1 10 Explanation: The smallest …

  7. C# Program to find Minimum Value of an Array | CodeToFun

    Oct 27, 2024 · Compile and run the program to see the minimum value of the array. The program defines a function FindMinValue that takes an array as input and returns the minimum value. …

  8. C# Program to Find Smallest Element in Array - Online Tutorials …

    Learn how to write a C# program to find the smallest element in an array with easy-to-understand examples and explanations.

  9. C# Find Minimum Value in Array with Min () Method

    In this example we are finding out the minimum values from an int array with Min() Method.

  10. C# program to find the largest and smallest numbers in an user given array

    In this post, we will learn how to find the largest and smallest numbers in an user given array. Our program will ask the user to enter the size of the array. It will then take the numbers as inputs …