SoFunction
Updated on 2025-03-06

C# Example of method to implement input 10 numbers into an array and calculate max, min and average

This article describes the method of C# implementing input 10 numbers stored in an array and finding max, min and average numbers. Share it for your reference, as follows:

using System;
using ;
using ;
using ;
namespace ConsoleApplication1
{
  class Program
  {
    static void Main(string[] args)
    {
      int nu1, max,min,number;
      int[] str = new int[10];
      for (nu1 = 0; nu1<10; nu1++)
        str[nu1] = (());
      max = str[0];
      min = str[1];
      number = 0;
      for (nu1 = 0; nu1 < 10; nu1++)
      {
        number += str[nu1];
        if (str[nu1] > max)
          max = str[nu1];
        if (str[nu1] < min)
          min = str[nu1];
      }
        number /= 10;
      ("max is :{0}",max);
      ("min is :{0}", min);
      ("pingjun is :{0}", number);
      ();
    }
  }
}

PS: Here are a few calculation tools for you to refer to:

Online unary function (eq) solution calculation tool:
http://tools./jisuanqi/equ_jisuanqi

Scientific Calculator Online Use_Advanced Calculator Online Calculator:
http://tools./jisuanqi/jsqkexue

Online Calculator_Standard Calculator:
http://tools./jisuanqi/jsq

For more information about C#, you can also view the special topic of this site: "Summary of C# string operation skills》、《C# data structure and algorithm tutorial》、《Tutorial on the usage of common C# controls》、《Summary of WinForm control usage》、《Summary of thread usage techniques for C# programming》、《Summary of C# array operation skills"and"Introduction to C# object-oriented programming tutorial

I hope this article will be helpful to everyone's C# programming.