Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- int a,b,c,x;
- printf("Enter a number : ");
- scanf("%d", &x);
- for(a=1;a<x;a++)
- {
- for(b=1;b<x-a;b++)
- printf("");
- for(c=1;c<a;c++)
- printf("%d",c);
- printf("\n");
- }
- for(a=x;a>=1;a--)
- {
- for (b=1;b<=x-a;b++)
- printf("");
- for (c=1;c<=a;c++)
- printf("%d",c);
- printf("\n");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement