title: What's The Best Logic For Sort an Array?
body: <p>Let's Say We Have an Array Of Int :</p>
  <pre><code>int[] array = new int[5];
  </code></pre>
  <p>and inside of this array we have a 5 randomly numbers..</p>
  <pre><code>array = {10,5,7,0,3};
  </code></pre>
  <p>What Would be The Best Way To Change That array To This Array By Code</p>
  <pre><code>array[0]=0;
  array[1]=3;
  array[2]=5;
  array[3]=7;
  array[4]=10;
  </code></pre>
  <p>For Me i Thought about Creating Two Loops One Of i and One of j..</p>
  <p>im gonna take the position 0 (i) and compare it with All the Other Numbers in The Array. i mean The positions j which is started from (i+1) till the end of the array (array.Length).</p>
  <p>Then When i'll found that array[i] is Upper Than array[j] Simply i'll Change The first Value with The Other...</p>
  <p>and Of course Here i need To Declare variable To Make That Change as shown :</p>
  <pre><code>int[] array = new int[5]{10,5,7,0,3};
  int Change;
  for(int i =0;i&lt;array.Lenght;i++)  
  {
      for(int j =i+1;j&lt;array.Lenght;j++)  
       {
         if(array[i]&gt;array[j])
          {
             change=array[i];
             array[i] = array[j];
             array[j] = change;
          }
      }
  }
  </code></pre>
  <p>This is solve The Problem But even thought i don't Like That Logic || that Code</p>
  <p>if you have another one Can You Tell Me About it ??</p>