#include <stdio.h>  
      int main()  
      {
          int n, i, j;
          printf("Enter number of rows : ");
          scanf("%d",&n);
          for(i=1; i<=n; i++)
          {
              for(j=1;j<=n-i;j++)
              {
                  printf(" ");
              }
              for(j=1;j<=i*2-1;j++)
              {
                  printf("%d",j);
              }
              printf("\n");  
          }
          for(i=n-1;i>0;i--)
          {
              for(j=1;j<=n-i;j++)
              {
                  printf(" ");
              }
              for(j=1;j<=i*2-1;j++)
              {
                  printf("%d",j);
              }
              printf("\n");
          }
          return 0;
      }  
      
      C language logo

      Diamond numbers pattern printing

      0

      0

      avatar
      drzyadav

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.