title: Want To Validate The Index Number Of A Given Array Using If
body: <pre><code> class Palette
   {  
        public static void Main()
        {    
             int array = new int [5];
             if (array[] = 0)
             {
                     Console.WriteLine("It's blue");
             }
             if (array[] = 1)
             {
                     Console.WriteLine("It's Violet");
             }
             if (array[] = 2)
             {
                     Console.WriteLine("It's red");
             }
             if (array[] = 3)
             {
                     Console.WriteLine("It's Black");
             }
             if (array[] = 4)
             {
                     Console.WriteLine("It's green");
             }
             Random ran = new Random();
             int r = ran.Next(array.Length);
             string Token = (array[r]);
             Console.WriteLine(Token);
     }
  }
  </code></pre>
  
  <hr>
  
  <p>This is not working. How can i make it work.</p>