i have this code,and it works.but after running it closes after milliseconds.anywhere i put "getch()" gives error.what to do?
#include <iostream>
using namespace std;
int main()
{
int i,j,k;
for( i = 10; i >= 1; i-- )
{
for( j = 1; j < i; j++ )
{
cout << " ";
}
for( k=10; k >= j*3; k-- )
{
cout << "*";
}
cout << "\n";
}
for( i = 2; i <= 10; i++ )
{
cout << " ";
for( j = 2; j < i; j++ )
{
cout << " ";
}
for( k = 10; k >= j * 2; k-- )
{
cout << "*";
}
cout << "\n";
}
return 0;
}