or download this
#include<stdio.h>
int p,n;void q(int x){int j;if(!x)return;for(j=1;j<=n-x;j++)printf(" "
+);for(j=1;j<=x;j++)printf("*");printf("\n");if(x>=n)p=-1;q(x+p);}void
+ main(){printf("Enter the number of columns: ");scanf("%d",&n);p=1;q(
+1);}