A slight modification of your code and it is working well.Just carefully go through the program and see how it works.
Code:
#include <stdio.h>
#include <stdlib.h>
int main()
{
int space, row, stars, i,number_of_stars;
printf("How many rows you want?");
scanf(" %d", &row);
for (i = 1; i <= row; i++)
{
number_of_stars=i;
for (space = 1; space <=row-i; space++)
{
printf(" ");
}
for (stars = 1; stars <= number_of_stars; stars++)
{
printf(" *");
}
printf("\n");
}
return 0;
}