Contenido del Curso
C# Basics
C# Basics
Indexing Practice
Find the mean between the largest and the smallest element of the numbers
array.
Mean, also called average, represents the central number between two or more than two numbers. For-example the mean value between 1
and 5
is 3
.
The formula for finding mean between two numbers sum of the two numbers divided by 2: (num1 + num2) / 2
Use indexing to access the smallest and the largest elements of the array.
main
- The
sum
variable should contain the sum of the two values. - Figure out the index of the smallest and the largest elements of the
numbers
array and access those elements via indexing (numbers[index]
), then store their sum in thesum
variable. - The
mean
will be the sum divided by 2.
main
¿Todo estuvo claro?