Single Line Conditions and Loops - Best Practice
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://programmers.stackexchange.com/questions/2715/should-curly-braces-appear-on-their-own-line">Should curly braces appear on their own line?</a>  </p>
</blockquote>



<p>Which would be a better way to format single line loops and conditions in C Sharp</p>

<pre><code>if (i &lt; j) 
{
    arr[i] = sum;
}
foreach (int k in arr)
{
    Console.WriteLine(k);
}
</code></pre>

<p>or</p>

<pre><code>if (i &lt; j) 
    arr[i] = sum;
foreach (int k in arr)
    Console.WriteLine(k);
</code></pre>

<p>or</p>

<pre><code>if (i &lt; j) arr[i] = sum;
foreach (int k in arr) Console.WriteLine(k);
</code></pre>
