Pattern magic problem

can anybody please provide me the solution

can anybody provide me the logic and the code please

Hi @bakshianjali49,
The given pattern is seen as first stars then spaces and then stars .So for each row do the work of stars fist , then that of spaces and then that of stars. And then change the variables accordingly for next iterations…

refer this code -->
https://ide.codingblocks.com/s/650459?_ga=2.59709869.1072852865.1671716885-672608080.1602772177