From b6b4214b824ec797bcadffc6c2a326ad279039b5 Mon Sep 17 00:00:00 2001 From: Jatin Vishwakarma <119022686+coddingjatin@users.noreply.github.com> Date: Thu, 17 Oct 2024 17:37:33 +0530 Subject: [PATCH] Create pattern11.c --- C/pattern11.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 C/pattern11.c diff --git a/C/pattern11.c b/C/pattern11.c new file mode 100644 index 0000000..e299a55 --- /dev/null +++ b/C/pattern11.c @@ -0,0 +1,27 @@ +#include +int main() +{ + int rows = 5; + for (int i = 0; i < rows; i++) { + for (int j = 0; j < 2 * i + 1; j++) { + printf(" "); + } + for (int k = 0; k < 2 * (rows - i) - 1; k++) { + if (k == 0 || k == 2 * (rows - i) - 2 || i == 0) + printf("* "); + else { + printf(" "); + } + } + printf("\n"); + } + return 0; +} + +/* Output +* * * * * * * * * + * * + * * + * * + * +*/