From 6d0859617b8feadf9b6fa0f85782cc739f1634e7 Mon Sep 17 00:00:00 2001 From: karanghuge01 Date: Thu, 17 Oct 2024 20:44:38 +0530 Subject: [PATCH] add new c pattern --- C/pattern 11.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 C/pattern 11.c diff --git a/C/pattern 11.c b/C/pattern 11.c new file mode 100644 index 0000000..52beaa5 --- /dev/null +++ b/C/pattern 11.c @@ -0,0 +1,21 @@ +#include + +int main() { + int n; + + printf("Enter number of rows: "); + scanf("%d", &n); + + for (int i = 1; i <= n; i++) { + for (int j = 1; j <= n; j++) { + if (i == 1 || i == n || j == 1 || j == n) { + printf("* "); + } else { + printf(" "); + } + } + printf("\n"); + } + + return 0; +} \ No newline at end of file