From ccff656bb4067363d799d96d3b126958ef1b6199 Mon Sep 17 00:00:00 2001 From: EcSolticia Date: Thu, 26 Dec 2024 13:37:17 +0600 Subject: [PATCH] Fixed logical error in count.c Previously, the conditional would check for an impossible condition (`i == num + 1`), making its block ineffective. The proposed update correctly inserts "]" after the counting is done for `num > 20'. --- count.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/count.c b/count.c index 86a297c..3a0ea71 100644 --- a/count.c +++ b/count.c @@ -12,7 +12,7 @@ int count(int num) for(i = 0; i < num; i++) printf("\n%d, \n", i); - if(i == num + 1) + if(i == num) printf("]"); } else {