63 103
Assignments Done
99%
Successfully Done
In July 2018

Answer to Question #7621 in C++ for Yaser

Question #7621
Write a program that displays a square box with “@” whose side is specified by a variable “side”. The
value of “side” will be input from the user of your program. (side>2)
For example, if side is 4, the program displays:
@@@@
@ @
@ @
@@@@
Expert's answer

# include<iostream.h>
# include<conio.h>

int i,k,n;

void main(){
cout<<"enter a side: ";
cin>>n;
for (i=1;i<=n;i++) cout<<"@";
cout<<"\n";
for (i=1;i<=n-2;i++){
& cout<<"@";
& for (k=1;k<=n-2;k++) cout<<" ";
& cout<<"@";
& cout<<"\n";
}
for (i=1;i<=n;i++) cout<<"@";
cout<<"\n";
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions