From 662ea9235a1372282c38c07b11e28308cc5300b9 Mon Sep 17 00:00:00 2001 From: SayanKar <44398655+SayanKar@users.noreply.github.com> Date: Tue, 20 Aug 2019 20:10:54 +0530 Subject: [PATCH] Added Diamond Printing Example.md (#36637) Added Example of a Diamond Printing code --- guide/english/c/loops/index.md | 60 ++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/guide/english/c/loops/index.md b/guide/english/c/loops/index.md index f759f10af3..33ba8636b1 100644 --- a/guide/english/c/loops/index.md +++ b/guide/english/c/loops/index.md @@ -664,3 +664,63 @@ int main() return 0; } ``` +#### Example 11: Print Diamond. +``` + * + *** + ***** + ******* + ********* + ******* + ***** + *** + * +``` + +**Source Code** + +```c +#include + +int main() +{ + int i, j, k, n; + + printf("Enter n: "); + scanf("%d",&n); + + for(i=0;i=0;k--) + { + printf("*"); + } + + printf("\n"); + } + + + return 0; +} + +```