You are on page 1of 1

Box Example

============================================
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int length;
cout<<"Enter The Length of the Box: ";
cin>>length;
int total=length*length;

for (int i=1;i<=total;i++)


{
if (i<length||i>total-length||i%length==1)
cout<<"*";
else if (i%length==0)
cout<<"*"<<endl;
else
cout<<" ";
}

getch();
}

http://www.ravianeducation.blogspot.com
FARHAN: 03008855006