Pattern printing

I am unable to find out the preparation to be done ,when we move to the next row … i need help in the work to be done and the preparation part

Just think of it this way. You first need to print a line of n asterisks. Then for n - 2 lines you need to print asterisk followed by n - 2 spaces followed by an asterisk. Then simply print another line similar to the first line.