Hi,
I have a code that makes a rectangle with "*" when I cin 2 numbers for width and Height, like this:
******
******
******
******
But now i have to make a rectangle that is empty inside.
Can anyone explain it to me?
Here is my code:
#include <iostream>
using namespace std;
int main(int argc, char **argv) {
int Height, Width;
cin >> Height;
cin >> Width;
for (int i = 0; i< Width; i++) {
for(int j = 0; j < Height; j++)
{
cout << "*";
}
cout << endl;
}
}
Last edited on
Thank you, that's it. You are a lifesaver! :)