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