26 lines
325 B
C
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");
|
|
}
|
|
}
|