summaryrefslogtreecommitdiff
path: root/wk2/sect2
diff options
context:
space:
mode:
authorFudgerboy <91767657+Fudgerboy@users.noreply.github.com>2023-12-06 04:34:47 +0000
committerFudgerboy <91767657+Fudgerboy@users.noreply.github.com>2023-12-06 04:34:47 +0000
commit9f8a6d07413b578dbd15b2f3861ebab6b23c6b44 (patch)
tree2061247af167aeccbccdfb077343c40a178d15f5 /wk2/sect2
parent4129bfe87efc136c28294c9efdceea5719e99383 (diff)
Tue, Dec 5, 2023, 8:34 PM -08:00
Diffstat (limited to 'wk2/sect2')
-rw-r--r--wk2/sect2/array.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/wk2/sect2/array.c b/wk2/sect2/array.c
index 708ac0f..f6f2609 100644
--- a/wk2/sect2/array.c
+++ b/wk2/sect2/array.c
@@ -11,13 +11,15 @@ int main(void)
while (n < 1);
int array[n];
array[0] = 1;
- printf("1\n");
int i = 1;
do
{
array[i] = array[i-1] * 2;
- printf("%i\n", array[i]);
i++;
}
while (i < n);
+ for (int j = 0; j < n; j++)
+ {
+ printf("%i\n", array[j]);
+ }
}