#include
main()
{
int n, c, k, space;
printf("Enter number of rows\n");
scanf("%d",&n);
space = n;
for ( k = 1 ; k <= n ; k++ )
{
for ( c = 1 ; c < space ; c++ )
printf(" ");
space--;
for( c = 1 ; c <= k ; c++ )
printf("*");
printf("\n");
}
getch();
return 0;
}
----------------------
output:-
Enter number of rows
7
*
**
***
****
*****
******
*******
No comments:
Post a Comment