Slt. QQ'un pourrait me dire pourquoi la boucle s'éxécute 6 fois au lieu des 5 demandées. Merci voici le code:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 #include <stdio.h> int main(void) { float PrixHT , PrixTTC ; int i=0, temp; while(i<=5) { printf("Entrez le prix HT:"); scanf("%f" , &PrixHT); PrixTTC = PrixHT * 1.2f ; printf("Le prix TTC = %.2f\n", PrixTTC); i++; } scanf(".2f,&temp); return 0; }
Partager