Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* This is my program of mario */
- #include <stdio.h>
- #include <cs50.h>
- int main(void) //the main program
- {
- int h, j, v; //Declaring variables
- do
- {
- printf("how height \n Height: "); //asking the user how heigh he wants his pyramid
- h = GetInt(); // get the number and save it to h = height
- }
- while (h<0 || h>23 );
- for (j=h+2; j>=1; j--)
- {
- for (v =3; v<=h+2; v++)
- if (v < j)
- printf(" ");
- else
- printf("#");
- printf("\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement