Advertisement
Nahid8195

Untitled

Sep 28th, 2022
905
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.42 KB | None | 0 0
  1. #include <stdio.h>
  2. int main()
  3. {
  4.     int i, j, k, l, n;
  5.     printf("Enter the number of rows: ");
  6.     scanf("%d", &n);
  7.     for (i = 0; i < n; i++) {
  8.         for (j = (n - 1); j >= i; j--){
  9.             printf(" ");
  10.         }
  11.         for (k = i; k >= 0; k--){
  12.             printf("%d", k);
  13.         }
  14.         for (l = 1; l <= i; l++) {
  15.             printf("%d", l);
  16.         }
  17.         printf("\n");
  18.     }
  19. }
  20.  
  21.  
  22.  
  23.  
Tags: Pyramidd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement