From 9d5b1d47cfaf4bf0471ce8ee1d1b610e0c22bd5e Mon Sep 17 00:00:00 2001 From: Yannis DOUMIR FERNANDES Date: Tue, 24 Oct 2023 09:13:03 +0200 Subject: [PATCH] =?UTF-8?q?Mise=20=C3=A0=20jour=20de=20'src/app/interface/?= =?UTF-8?q?interface=5Fresp.c'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/interface/interface_resp.c | 34 +++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/src/app/interface/interface_resp.c b/src/app/interface/interface_resp.c index 495d6a7..b1ef8ac 100644 --- a/src/app/interface/interface_resp.c +++ b/src/app/interface/interface_resp.c @@ -57,10 +57,42 @@ void affichAjoutArticle(int *ref, float *poids, float *volume, float *prix) { printf("Entrez la ref du nouveaux produit"); scanf("%d", ref); + if ( ref < 0 ) + { + while ( ref < 0 ) + { + printf("Entrez un nombre correct !"); + scanf("%d", ref); + } + } printf("Entrez le poids du nouveaux produit"); scanf("%f", poids); + if ( poids < 0 ) + { + while ( poids < 0 ) + { + printf("Entrez un nombre correct !"); + scanf("%d", poids); + } + } printf("Entrez le volume du nouveaux produit"); - scanf("%f", volume); + scanf("%f", poids); + if ( poids < 0 ) + { + while ( poids < 0 ) + { + printf("Entrez un nombre correct !"); + scanf("%d", poids); + } + } printf("Entrez le prix du nouveaux produit"); scanf("%f", prix); + if ( prix < 0 ) + { + while ( prix < 0 ) + { + printf("Entrez un nombre correct !"); + scanf("%d", prix); + } + } } \ No newline at end of file