Program to print Full Pyramid using * in C++

Following is the program to print Full Pyramid using *.

#include<iostream.h>

int main()
{
    int space, rows;

    cout <<"Enter number of rows: ";
    cin >> rows;

    for(int i = 1, k = 0; i <= rows; ++i, k = 0)
    {
        for(space = 1; space <= rows-i; ++space)
        {
            cout <<"  ";
        }

        while(k != 2*i-1)
        {
            cout << "* ";
            ++k;
        }
        cout << endl;
    }    
getch();
return 0 ;
}

Enter number of rows: 5 * * * * * * * * * * * * * * * * * * * * * * * * *