diff --git a/diamond.c.c b/diamond.c.c new file mode 100644 index 0000000..3c9fe73 --- /dev/null +++ b/diamond.c.c @@ -0,0 +1,32 @@ +#include + +void main(){ + int n , r, c; + printf("enter the number of rows"); + scanf("%d",&n); + for(r=1;r<=n;r++) + { + for(c=1;c<=n-r;c++) + { + printf(" "); + } + for (c=1;c<=2*r-1;c++) + { + printf("*"); + } + printf("\n"); + } + for(r=n-1;r>=1;r--) + { + for(c=1;c<=n-r;c++) + { + printf(" "); + } + for (c=1;c<=2*r-1;c++) + { + printf("*"); + } + printf("\n"); + } + +} \ No newline at end of file