Optimize hollow diamond pattern printing in c with minimum loops
<p>Am trying to print hollow diamond pattern with * outline with minimum loops. I optimized with 2 loops. </p>

<p>My output using 2 loops</p>

<pre><code>Enter no of rows: 5
***********
***** *****
****   ****
***     ***
**       **
*         *
**       **
***     ***
****   ****
***** *****
***********
</code></pre>

<p>Is there any other way to still optimize this code?</p>

<pre><code>void main()
{
        int row,col,n,k;

        printf("Enter no of rows: ");
        scanf("%d",&amp;n);

        for(row=0, k=1; row&lt;=2*n; row&gt;n?k++:k, printf("\n"), row++)
                for(col=-n; col&lt;=n; col++)
                        (col&gt;0?col:-col) &lt; (row&lt;=n?row:(row-2*k)) ? printf(" ") : printf("*");
}
</code></pre>

<p>'</p>