Problem code not working

#include <stdio.h>

int main(){

int n,j,i;

scanf("%d",&n);

for(i=0;i<n;i++){

  j=i;

  while((n-i-1)>0){

      printf(" ");

      i++;

  }

  while(j>=0){

      printf("*");

      j--;

      

  }

  printf("\n");

}

return 0;

}

//above is one is my code;
//if i give n=5
it should print
*
**




but is giving output
*

and stopped
please help me

help me to build a GitHub repo where we can find all solution on one place easy to learn …
https://github.com/SiddhantManze/My-Codechef-submission

mate give me problem link
first

s