#include #include /* This proram prints tha same but uses the %*d capability of printf to specify the width in a separeate parameter. * ** *** **** ***** ****** ******* ******** ********* ********** */ int main() { int n,i,j; //printf("[%*d]\n", 9, 5); == printf("[%9d]\n", 5); //printf("[%10c]\n", ' '); for(n=1; n<=10; n++) //outer loop { if(10-n != 0) printf("%*c", 10-n, ' '); // The above code replaces this one. // for(j=10-n; j>0; j--) // printf(" "); for(i=1; i<=n; i++ ) // inner loop printf("*"); printf("\n"); } system("pause"); }