Q:

trying the perfect square can you give some tip

using only iostream why the first # is on (0) and second # is (19) and so on why ?
int main (){
const int walla=20; //declaring//
const int wallb=20;
const int coordinatx=walla/2;   
const int coordinaty=wallb/2;   
for(int i=0; i<walla; i++){
    cout<<"#";   //walla//
}
cout<<endl; 

    for(int i=0; i<wallb; i++){
        for (int j=0;j< walla; j++)
        if(j==0 )
            cout<<"#\n";   //trying wallb//
        else if(j==19)
            cout<<string(j,'\0');
            cout<<"#\n";
    }
}

//coding coordinat that prints input ty for checking (://

A:

Printing \n change line and '\0' is not printable.
You probably want:
std::cout << std::string(walla, '#') << std::endl;
for (int i = 0; i < wallb - 2; i++) {
    std::cout << '#' << std::string(walla - 2, ' ') << '#' << std::endl;
}
std::cout << std::string(walla, '#') << std::endl;

Demo

