Coding in C not working - I am totally new and confused lol


#1

I want to write a program called mario and its suppose to be a pyramid, but I keep getting error messages and I have been googling till I am blue, I am not sure how to use both “for loops” and “do while loops” in one program(thats what the assignment requires - CS50x through Harvard Online), Here is what I’ve got so far…please please please help!!! Thanks so so much…

It should look like this:
**
***
****

I am prompting the user for a number(height of pyramid) if its higher that 23 I am printing to “retry.”

I keep getting 14 error messages or so and it keeps saying I havent int height!WHAT??? Soooo confused guys…

#include<stdio.h>
#include<cs50.h>

void buildpyramid();

int main(void)
{
int height = get_int();
buildpyramid(height);

}

int height = 0;

do
{
    printf("##%i\n", height);
    height = height + 1;
}

while (height > 0 && height < 23);

do
{
    printf("Retry.");
}

while (height < 0 || > 23);

for (i = 0, i < n, i++)
{
printf("##", i);
}

for (j = 0, j < height - i - 1, j++)
{
printf(" ");
}

void buildpyramid(height)
{
printf(“How high do you want the pyramid?%i\n”, height);
}