Wish I learned coding very useful in todays day and age @Neb
3 Likes
Taking a shot…
this #
1 Like
Return 0
Do I win? Lol
1 Like
#include <cs50.h>
#include <stdio.h>
int main(void)
{
int height, a, b, space; // a = row && b = column
do
{
height = get_int("Height: ");
}
while (height < 1 || height > 8);
for (a = 0; a < height; a++)
{
for (space = 0; space < height - a - 1; space++)
{
printf(" ");
}
for (b = 0; b <= a; b++)
{
printf("#"); // left half of pyramid
}
printf(" ");
for (b = 0; b <= a; b++)
{
printf("#"); // right half
}
printf("\n");
}
}
3 Likes
number of Left brackets less than # of right brackets
3 Likes
We have a winner!
for (a = 0; a < height; a++)
**{** This opening bracket was missing.
for (space = 0; space < height - a - 1; space++)
8 Likes
But I even cracked my knuckles before typing
7 Likes
This topic was automatically closed after reaching the maximum limit of 5000 replies. Continue discussion at Free Seeds & Free Clones Thread (Part 13).