summaryrefslogtreecommitdiff
path: root/wk2/sect2/array.c
diff options
context:
space:
mode:
authorFudgerboy <91767657+Fudgerboy@users.noreply.github.com>2023-12-06 04:41:31 +0000
committerFudgerboy <91767657+Fudgerboy@users.noreply.github.com>2023-12-06 04:41:31 +0000
commitb88da46eace37517325e9f7890a561d8af5e7e41 (patch)
treefd18d8efcfab4e9f6f22d4ad41bfbe1c52cd008a /wk2/sect2/array.c
parent2ca31174026204bcd71c0ebb3bf3fe859da8bb96 (diff)
Tue, Dec 5, 2023, 8:41 PM -08:00
Diffstat (limited to 'wk2/sect2/array.c')
-rw-r--r--wk2/sect2/array.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/wk2/sect2/array.c b/wk2/sect2/array.c
index 093a7a1..14655f6 100644
--- a/wk2/sect2/array.c
+++ b/wk2/sect2/array.c
@@ -11,8 +11,7 @@ int main(void)
while (n < 1);
int array[n];
array[0] = 1;
- int i = 1;
- do
+ for (int i = 0; i < n; )
{
array[i] = array[i - 1] * 2;
i++;