#define _CRT_SECURE_NO_WARNINGS

#include <string>

#include <stdio.h>

#include <stdlib.h>

#include <iostream>

#include<stdio.h>

int main(int argc, char** argv) {

	int i, j, n;
	int count;

	printf("Please insert a number: ");
	scanf("%d", &n);

	count = n;
// loop until i is = to user input
	for (i = 1; i <= count; i++)
	{

	// when i is increased the overall total decreases e.g. 5-1=4 when i becomes 2, 5-2 = 3 etc....
		for (j = 1; j <= count; j++)
		{
			if (j == i || (j == count - i + 1))
			{
				printf("*");
			}
			else
			{
				printf(" ");
			}
		}

		printf("\n");
	}
	system("PAUSE");
	return 0;
}