HAS TO BE IN C NOT C++ 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
@@@@
@ @
@ @
@@@@
1
Expert's answer
2013-03-11T11:32:43-0400
# 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<<" "; for (i=1;i<=n-2;i++){ cout<<"@"; for (k=1;k<=n-2;k++) cout<<" "; cout<<"@"; cout<<" "; } for (i=1;i<=n;i++) cout<<"@"; cout<<" "; }
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot
Comments
Leave a comment