C: Formater l’affichage avec ‘printf’

Author:


Download


#include 

int main()
{
   printf ("Caractères: %c %c n", 'a', 65);

   printf ("Décimals: %d %ldn", 205200, 1000);

   printf ("Justification à droite: %10d n", 1985);

   printf ("Ajouter '0' au début: %010d n", 1965);

   printf ("nombre à base: %d %x %o %#x %#o n", 120, 120, 120, 120, 120);

   printf ("Nombre à vrigule: %4.2f %+.0e %E n", 3,14159265, 3,14159265, 3,14159265);

   printf ("Largeur: %*d n", 53, 140);

   printf ("Chaîne de caractère: %s n", "Bonjour tous le monde.");
   return 0;
}

Leave a Reply

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