From 2d6791220fc35e2f6c7a728ec2f48453cdb8b315 Mon Sep 17 00:00:00 2001 From: Alvie Rahman Date: Fri, 6 Oct 2023 13:28:11 +0100 Subject: [PATCH] explain method of validation in c8e7 --- C8/ex7.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/C8/ex7.c b/C8/ex7.c index 53cc081..74c7e5f 100644 --- a/C8/ex7.c +++ b/C8/ex7.c @@ -7,7 +7,7 @@ int main() { printf("Enter radius: "); rc = scanf("%f", &radius); - // scanf returns number of scanned items + // scanf returns number of scanned items. If input is invalid then 0 values will have been scanned. if (rc != 1) { printf("Please enter an positive real integer or decimal\n"); return 1; @@ -15,7 +15,7 @@ int main() { printf("Enter height: "); rc = scanf("%f", &height); - // scanf returns number of scanned items + // scanf returns number of scanned items. If input is invalid then 0 values will have been scanned. if (rc != 1) { printf("Please enter an positive real integer or decimal\n"); return 1;