Thursday, February 20, 2014

Example of Assign value to C# variable.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ValueVariable
{
    class Program
    {
        static void Main(string[] args)
        {
            int a, b;
            a = 20;
            Console.WriteLine("Value of A = " + a);

            b = a / 2;
            Console.WriteLine("Value of B = " + b +"  (a/2)");

            Console.ReadLine();
        }
    }
}

Output:


No comments:

Post a Comment