cours_langage-C-02-ES.pdf - Programmation en C Gal...

This preview shows 1 out of 7 pages.

Programmation en C Gaël Chareyron [email protected] d’après T. Raimbault ESILV
Image of page 1

Subscribe to view the full document.

Entrée et sortie standard 1 Entrée et sortie standard Prog. en C ESILV – S5 2
Image of page 2
Entrée et sortie standard Les entrées/sorties (clavier, écran, fichiers, etc. ) sont traitées via des appels de fonctions existantes. utilisation de la bibliothèque stdio.h e.g. printf , scanf , getchar et putchar Prog. en C ESILV – S5 3
Image of page 3

Subscribe to view the full document.

Entrée et sortie standard Sortie formatée Sortie mise en forme Syntaxe ( printf ) int printf ( chaine _ formatee , arg 1 , arg 2 , ..., arg n ) Code 1 #include <stdio.h> 2 /* ... */ 3 printf( "Hello" ); 4 printf( "\n" ); 5 printf( "%s\n" , "Hello" ); 6 int prix = 100; 7 printf( "Prix TTC : %d" , prix); Exemple (Résultat sur l’écran) Hello Hello Prix TTC : 100 Prog. en C ESILV – S5 4
Image of page 4
Entrée et sortie standard Sortie formatée Formatage : Format Type en C Type Écriture formatée %d int entier décimale (base 10) %ld long int entier (long : 64 bits) décimale (base 10) %u unsigned int entier > 0 (non signé) décimale (base 10) %o octale (base 8) %x hexadécimale (base 16) %lu unsigned long int
Image of page 5

Subscribe to view the full document.

Image of page 6
Image of page 7
You've reached the end of this preview.
  • Spring '14
  • Chaîne de caractères, Gaël Chareyron, T. Raimbault, sortie standard, Développement décimal

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern