x = 5
while the value of x is not equal to 0
y = 5
while the value of y is not equal to 0
if the value of y less than or equal to x
print an asterisk
print a space
print a newline
To print that output you have to use three loops.
1.) one is the outer loop used to present the rows.
2.) second is a inner loop which will print spaces.
3.) third is again a inner loop which will be placed just after secong loop and will print "*".
so here is the layout-
for(how many rows you want)
for(print a triangle of " " (spaces)
for(print a reverse triangle of "*")