[tab name=’♣ Exercice langage C’]
Quels seront les résultats fournis par ce programme :
#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) ; }
[/tab][tab name=’Correction’]
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 :
Exercice informatique, Correction exercice, Télécharger Exercice, Solution exercice, Exercice langage C
[/tab][end_tabset skin= »lightness » ]