/******************************************** * Section : 15 * Machine No. : N * Roll No. : 19CS100XY * Name : Aritra Hazra * Assignment No : 3C * Description : Boundary Drawing with Numbers *********************************************/ #include int main() { int i, j, n; printf("Enter Positive Number for Outermost Boundary [1-99]: "); scanf("%d", &n); if (n<=0) { printf("Error: Boundary cannot be designed!\n"); } else { printf("The Drawing:\n"); for (i=n; i>1; i--) { for (j=n; j>=1; j--) { if (j>i) printf("%3d", j); else printf("%3d", i); } for (j=2; j<=n; j++) { if (j>i) printf("%3d", j); else printf("%3d", i); } printf("\n"); } for (i=1; i<=n; i++) { for (j=n; j>=1; j--) { if (j>i) printf("%3d", j); else printf("%3d", i); } for (j=2; j<=n; j++) { if (j>i) printf("%3d", j); else printf("%3d", i); } printf("\n"); } } return 0; }