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