Correction problème de conversion (int > float)

doc
Rémi LAVERGNE 2 years ago
parent d057c9aad1
commit 4cf977f459

@ -45,7 +45,8 @@ void modifyClient(int clientID[], float cagnotte[], int suspended[], int tlog)
+var montant: montant à ajouter à la cagnotte
+var modif: modification à exécuter sur le client
*/
int index, numClient, montant;
int index, numClient;
float montant;
char modif;
printf("Entrez le numéro du client dont vous voulez modifier les données: ");
scanf("%d%*c", &numClient);
@ -70,7 +71,7 @@ void modifyClient(int clientID[], float cagnotte[], int suspended[], int tlog)
else if (modif == 'c')
{
printf("Entrez le montant à ajouter à la cagnotte: ");
scanf("%d", &montant);
scanf("%f", &montant);
cagnotte[index] += montant;
}
}

Loading…
Cancel
Save