// answer to coding question #3 // using two nested loops to display the figure #include using namespace std; void hob(int x) { int i, j; int last=x-1; for(i=0;i<=last;i++) { for(j=0;j<=last;j++) { if(i==0 || i==last) { if (j==0 || j==last) cout <<"+"; else cout <<"*"; } else { if (j==0 || j==last) cout <<"#"; else cout <<"x"; } } cout << endl; } } main() { hob(6); }