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 +* * * * * * * * * + * * + * * + * * + * +*/