Files
2026-05-28 10:16:10 +00:00

26 lines
325 B
C

#include <cs50.h>
#include <stdio.h>
// Prototype
void draw(int n);
int main(void)
{
int height = get_int("Height: ");
draw (height);
}
// Prototype now being used.
void draw(int n)
{
// for each row of pyramid
for (int i = 0; i < n; i++)
{
for (int j = 0; j < i; j++)
{
printf("#");
}
printf("\n");
}
}