Friday, April 29, 2016

Array of String and Float

using System;

namespace Array_2
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] names = new string[5];
            float[] scores = new float[5];
            names[0] = "Dara";
            scores[0] = 90;
            names[1] = "Kunthear";
            scores[1] = 95.5f;
            names[2] = "Veasna";
            scores[2] = 70;
            names[3] = "Sambo";
            scores[3] = 100;
            names[4] = "Bopha";
            scores[4] = 90;
            for (int i = 0; i < names.Length; i++)
            Console.WriteLine(names[i]+ "," + scores[i]);
            Console.ReadLine();
        }
    }
}


Output

 

No comments:

Post a Comment