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