C/C++: Exemple d’affichage des nombres en virgules*

Author:


Download

#include 

void main()
{
   float nombre1 = 123.678f;
   float nombre2 = 1.2345E6f;
   double nombre3 = 98765432.0;
   double nombre4 = 11.22334455e-6;

   printf("%f  %+f  % 10.4f  %6.4fn", nombre1, nombre2, nombre1, nombre2);
   printf("%e  %+En", nombre1, nombre2);
   printf("%f  %g  %#+f  %8.4f  %10.4gn", nombre3,nombre3, nombre3, nombre3, nombre4);
}

Leave a Reply

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