Advertisement
LePetitGlacon

FICHE 6 Exercice 6

Nov 12th, 2019
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.49 KB | None | 0 0
  1. using System;
  2.  
  3. namespace o
  4. {
  5.     class Program
  6.     {
  7.         public static void Main(string[] args)
  8.         {
  9.            
  10.           int[] tab10Valeurs = {25, 14, 50, 51,15, 14,13,12,18,18,138};
  11.           int somme = 0;
  12.            
  13.          
  14.          
  15.           for (int i = 0;i < tab10Valeurs.Length;i++) {
  16.             somme = somme + tab10Valeurs[i];
  17.           }
  18.           int moyenne = somme / tab10Valeurs.Length;
  19.           Console.WriteLine(moyenne);
  20.                
  21.             Console.ReadKey();
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement