Create box in C++ using For loop

#include
#include
void main(){
clrscr();
int s;
cout<<"enter the size of box: ";
cin>>s;
for(int i=1;i<=s;i++){
cout<<endl;
for(int j=1;j<=s;j++) {

if(i>1 && i=2 && j<s){
cout<<" ";
}
else cout<<"*";
}}
getch();
}

Published by Affairs Outline

Affairs Outline - Talking about current affairs around the glob

Leave a comment