Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Enter height: 10
- *******************
- * *
- * *
- * *
- * *
- * *
- * *
- * *
- * *
- *
- */
- #include<stdio.h>
- int main()
- {
- int h;
- printf("Enter height: ");
- scanf("%d", &h);
- printf("\n");
- for(int i=h; i>=1; i--)
- {
- for(int j=h; j>i; j--)
- {
- printf(" ");
- }
- for(int j=1; j<=i*2-1; j++)
- {
- if(j==1||j==i*2-1||i==h)
- {
- printf("*");
- } else {
- printf(" ");
- }
- }
- printf("\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement