#include <stdio.h>
#include <cs50.h>
int main(void)
{
//This do while loop checks if user entered number 1-8
int x;
do
{
x = get_int("Height: ");
}
while (x < 1 || x > 9);
//These for loops represnt the rows and columns
for (int i = 0; i < x; i++)
{
for (int j = 0; j < x; j++)
{
// Formula for telling if to print a hash
if (i + j >= x - 1)
printf("#");
else
printf(" ");
}
printf(" ");
printf("\n");
}
for (int i = 0; i < x; i++)
{
for (int j = 0; j < x; j++)
{
if (i + j >= x - 1)
printf("#");
}
printf("\n");
}
}
Cannot seem to get the triangles to print next to each other, the second one prints on the row below the the first triangle.