Quels seront les résultats fournis par ce programme :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
#include main () { int n = 543 ; int p = 5 ; float x = 34.5678; printf ("A : %d %f\n", n, x) ; printf ("B : %4d %10f\n", n, x) ; printf ("C : %2d %3f\n", n, x) ; printf ("D : %10.3f %10.3e\n", x, x) ; printf ("E : %-5d %f\n", n, x) ; printf ("F : %*d\n", p, n) ; printf ("G : %*.*f\n", 12, 5, x) ; printf ("H : %x : %8x :\n", n, n) ; printf ("I : %o : %8o :\n", n, n) ; } |
A : 543 34.567799
B : 543 34.567799
12 Exercices en langage C
C : 543 34.567799
D : 34.568 3.457e+01
E : 543 34.567799
F : 543
G : 34.56780
H : 21f : 21f :
I : 1037 : 1037 :