Calculer le pourcentage d’une valeur

Author:

ArrayList, Array, HashTable, BitArray
{filelink=18438}


using System;

  public static class CalculPourcentage
  {

    public static decimal GetPorcentage(decimal valeur, decimal total)
    {
      return valeur / total * 100;
    }

      public static void Main(string[] argv)
      {
          Console.WriteLine("Pourcentage de 15 sur un total de 300= {0}%",GetPorcentage(15, 300));
      }

   }

Leave a Reply

Your email address will not be published. Required fields are marked *