Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Last active April 3, 2019 19:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/b4839a97df6d9d87febf02655d83e93f to your computer and use it in GitHub Desktop.
Save parzibyte/b4839a97df6d9d87febf02655d83e93f to your computer and use it in GitHub Desktop.
/*
Promedio de valores de un arreglo en C#
usando Linq
@author parzibyte
*/
using System;
using System.Linq;
class MainClass {
public static void Main (string[] args) {
double[] calificaciones = {90, 98, 85, 95, 90, 80, 70, 100, 55};
// Simplemente llamamos a Average
double promedio = calificaciones.Average();
Console.WriteLine("Promedio: " + promedio);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment