Quasi Empty Square

how can we provide space between the square?

can you pls elaborate your doubt…where do you want to provide space?

I have a doubt with question=7,8,19,20,25,29,30,31,33 of pattern practice questions?

try solving them and post your code…

I want to make a square which is empty from inside there will be no star. I know the logic printing a shape but did not find a way to print the square empty from inside.

I am writing a pseudo code in which pattern I face a problem at the last row:
int n;
int nst=n;
int row=1;
int nsp=0;
while(row<=n){
for(int cst=1;cst<=nst;cst++){
print("");
}
for(int csp=1;csp<=nsp;csp++){
print(" “);
}
for(int cst=1;cst<=nst;cst++){
print(”
");
}
if(row<=n/2){
nsp=nsp+2;
nst–;
}
else{
nsp=nsp-2;
nst++;
}
jump;
row++;
end while
The code is working properly but the problem is that I want to print n lines but it prints n-1 and in the last line I do not want to print any space but it provides a space. this is a question number 19 of pattern practice

pls share the image of pattern




  •   *
    



&&
*
* *
* *
* *
* *
* *
*

you can print the last line of the pattern explicitly…
use another separate loop for printing the last line

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.