Q:

C++ asterisk loop program with space

I wanted to make:
      *
     * *
    * * *
   * * * *
  * * * * *
 * * * * * *

but I don't know how to make the spacing, the closest I can get is by using:
#include <iostream>
#include <conio.h>
using namespace std;

int main(int argc, char** argv) {
      int x, y;
  for (y = 0 ; y <= 5 ; y ++){
    for (x = 0 ; x < y ; x++) {
    cout<<" * ";
    }
  printf("\n");
 }
        getch ();
    return 0;
}

A:

I'll help you.. but just because it's almost Christmas
int x, y;
for (y = 0; y <= 5; y++) {
  for (x = 0; x < y; x++) {
    for (int i = 0; x == 0 && i < (5 - y); ++i)
      cout << ' ';
    cout << " *";
  }
  cout << '\n';
}

Example

