hollow rectangle pattern c 2b 2b

Solutions on MaxInterview for hollow rectangle pattern c 2b 2b by the best coders in the world

showing results for - "hollow rectangle pattern c 2b 2b"
Benjamín
21 Sep 2018
1#include<bits/stdc++.h>
2using namespace std;
3int main()
4{
5	int row,col;
6	cin>>row>>col;
7	for(int i=1;i<=row;i++){
8		for(int j=1;j<=col;j++){
9			if(i==1||i==row||j==1||j==col){
10				cout<<"*";
11			}
12			else{
13				cout<<" ";
14			}
15		}
16		cout<<endl;
17	}
18}
similar questions
queries leading to this page
hollow rectangle pattern c 2b 2b