HTML & JS
print("Give the value of n(odd):")
n=int(input())
x=n//2+1
for i,j in zip(range(1,x+1),range(1,n+1,2)):
    print(' '*(x-i)+'*'*(j))
for i,j in zip(range(1,x+1),range(n-2,-1,-2)):
    print(' '*(i)+'*'*(j))
    

Generated URL:

Output:

Give the value of n(odd):
    *
   ***
  *****
 *******
*********
 *******
  *****
   ***
    *
Report Bug