Stuck on a problem

Write a program that asks the user for 2 numbers: the width and the height. The program prints a box of asterisks of that width and height.

For example, if the user types in 5 and 3, the program outputs
*****
*****
*****..........
So far what i have is this and its not compiling.

#include <iostream>
using namespace std;
int main () {
int n;
{
cout<<"Give me a number"<<endl;
cin<<n;}
{
int i;
cout<<"Give me another number"<<endl;
cin<<i;}
{
while(n*i){
cout<<"**********"<<endl;
system("pause");
return 0;
}
}
also if you can provide an explanation to your solution i would appreciate it so that way i can better understand and learn from this as well. thank you.
You're welcome:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <cstdio>
#include <cstdlib>
#include <iostream>
using namespace std;

void Display(int height,int width)
{
    for(int i = 0;i < height;i++)
    {
        for(int i2 = 0;i2 < width;i2++)
        {
            cout << '\xB2';
        }
        cout << endl;
    }
}

int main(int nNumberofArgs,char* pszArgs[])
{
    int height,width;

    cout << "Enter height and then width to make box" << endl;
    cout << "Each 'square' is: " << '\xB2' << endl;
    cout << "Height: ";
    cin >> height;
    cout << "Width: ";
    cin >> width;

    Display(height,width);
    system("PAUSE");
    return 0;
}
closed account (18hRX9L8)
greenleaf, remember: using system() is evil. http://www.cplusplus.com/forum/articles/11153/
Topic archived. No new replies allowed.