fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int n;
  5. printf("Enter the number of rows: \n");
  6. scanf("%d",&n);
  7. int min=0;
  8. for(int i=1;i<=n;i++){
  9. for(int j=1;j<=n;j++){
  10.  
  11. int a=i;
  12. if(i>n) a= 2*n-i;
  13. int b=j;
  14. if(b>n) b= 2*n-j;
  15. printf("%d",min);
  16.  
  17. }
  18.  
  19. printf("\n");
  20.  
  21. }
  22. return 0;
  23. }
  24.  
Success #stdin #stdout 0s 5312KB
stdin
7
stdout
Enter the number of rows: 
0000000
0000000
0000000
0000000
0000000
0000000
0000000