TP Châine Construction Partie 1 Etape 3 et 4
Etape 3 et 4 a) Oui il est possible d'éxecuter le programme marlgrès le Warning.
b) Non car au moment ou il y a la multiplication, il y a un soucis d'affichage
c) Non
t.defait@www ~/tp0410/src [9:24:15]
> $ g++ -c arithmetique.s -o ../obj/arithmetique.o
t.defait@www ~/tp0410/src [9:24:36]
> $ g++ -o ../bin/arithmetique ../obj/arithmetique.o
t.defait@www ~/tp0410/src [9:25:05]
> $ ./../bin/arithmetique
Veuillez saisir le premier nombre entier :
10
Veuillez saisir le deuxième nombre entier :
12
Résultat de l'addition : 10 + 12 = 22
Résultat de la soustraction : 10 - 12 = -2
Résultat de la multiplication : 10210793612 = 120
FIN DU PROGRAMME - Pour un autre calcul, veuillez relancer le programme.
Correction de ce programme
cout << "\tRésultat de la multiplication : " << operandeA << ' * ' << operandeB << " = " << operandeA * operandeB << endl;
Remplacer le ' * ' par " * ".
TEST de la Correction :
t.defait@www ~/tp0410/src [9:38:17]
> $ g++ -E arithmetique.cpp -o arithmetique.ii -g
t.defait@www ~/tp0410/src [9:38:28]
> $ g++ -S arithmetique.ii -o arithmetique.s -g
t.defait@www ~/tp0410/src [9:38:36]
> $ g++ -c arithmetique.s -o ../obj/arithmetique.o
t.defait@www ~/tp0410/src [9:38:38]
> $ g++ -o ../bin/arithmetique ../obj/arithmetique.o
t.defait@www ~/tp0410/src [9:38:48]
> $ ./../bin/arithmetique
Veuillez saisir le premier nombre entier :
14
Veuillez saisir le deuxième nombre entier :
12
Résultat de l'addition : 14 + 12 = 26
Résultat de la soustraction : 14 - 12 = 2
Résultat de la multiplication : 14 * 12 = 168
FIN DU PROGRAMME - Pour un autre calcul, veuillez relancer le programme.