how to Print starik triangle in c++

To Print starik triangle in c++ like this way

**********
*********
********
*******
******
*****
****
***
**
*

You can write following code in c++ editor.

 void main(){  
 const int size=10,x=0;  
 for(int i=0;i<size;++i)  
 {  
 cout<<"\n";  
 for(int j=0;j<size-x;++j)  
 cout<<"*";  
 for(int k=0;k<x;++k)  
 cout<<" ";  
 ++x;  
 }  
 getch();  
 }