/*
Summary: Print stars in ascending order from right to left.
*/
#include<stdio.h>
int main()
{
int row, col, space, n;
printf("Enter the number of rows: ");
scanf("%d", &n);
for(row=1; row<=n; row++)
{
for(space=1; space<=n-row; space++)
printf(" ");
for(col=1; col<=row; col++)
printf("* ");
printf("\n");
}
return 0;
}
0 comments