title: Sorting string values without using any method/function
body: <p>I trying to do sorting without use of any method or function</p>
  
  <p>My Code :</p>
  
  <pre><code>   string[] names = { "Flag", "Nest", "Cup", "Burg", "Yatch", "Next" };                     
     string name = string.Empty;
     Console.WriteLine("Sorted Strings : ");
  
     for (int i = 0; i &lt; names.Length; i++)
          {
              for (int j = i + 1; j &lt; names.Length; j++)
              {
                  for (int c = 0; c &lt; names.Length; c++)
                  {
                      if (names[i][c] &gt; names[j][c])
                      {
                          name = names[i];
                          names[i] = names[j];
                          names[j] = name;
                      }
                  }
  
              }
              Console.WriteLine(names[i]);
          }
  </code></pre>
  
  <p>Please let me bring any solution for this code ?</p>
  
  <p>In this code i am getting <strong>"Index was outside the bounds of the array"</strong> exception </p>