diff options
author | Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> | 2024-02-17 23:57:48 +0000 |
---|---|---|
committer | Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> | 2024-02-17 23:57:48 +0000 |
commit | 3c2ae5e3880db7eba2f64dff019d569911221c43 (patch) | |
tree | 91f72a09a2080997b5b08f1b611684a00750c328 /wk3/lab/iteration.c | |
parent | 59a676d4d24dc73cb5052ff77c412e559ca235db (diff) |
Sat, Feb 17, 2024, 3:57 PM -08:00
Diffstat (limited to 'wk3/lab/iteration.c')
-rw-r--r-- | wk3/lab/iteration.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/wk3/lab/iteration.c b/wk3/lab/iteration.c new file mode 100644 index 0000000..46a68c9 --- /dev/null +++ b/wk3/lab/iteration.c @@ -0,0 +1,21 @@ +#include <cs50.h> +#include <ctype.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +void draw(int n); + +int main(void) { + int height = get_int("Height: "); + draw(height); +} + +void draw(int n) { + for (int i = 0; i < n; i++) { + for (int j = 0; j < i + 1; j++) { + print("#"); + } + printf("\n"); + } +} |