From 74bc26260ac1f3e5b1e69e6f04c03133a1c817fd Mon Sep 17 00:00:00 2001 From: sarthakd999 <72197269+sarthakd999@users.noreply.github.com> Date: Fri, 15 Oct 2021 11:45:34 +0530 Subject: [PATCH] Create sarthakdh.cpp --- Patterns/sarthakdh.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Patterns/sarthakdh.cpp diff --git a/Patterns/sarthakdh.cpp b/Patterns/sarthakdh.cpp new file mode 100644 index 00000000..f6bd1e9b --- /dev/null +++ b/Patterns/sarthakdh.cpp @@ -0,0 +1,21 @@ +int main() +{ + int n; + printf("Enter the 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; +}