Wednesday 27 July 2016

C Sharp Variable Scope

C# Variable Scope

class Program
    {
        static void Main(string[] args)
        {
            int n = 10;
            {
                int m = 20;
                {
                    int p = 30;
                    Console.WriteLine("N={0}\nM={1}\nP={2}", n, m, p);
                }

C Sharp Array Tutorial

C# Array Tutorial

class Program
    {
        static void Main(string[] args)
        {
            int[] ar = new int[5];
            for(int i=0;i<5;i++)

C Sharp Input Tutorial

C# Input Tutorial

 class Program
    {
        static void Main(string[] args)
        {
            int a, b, c;
            Console.Write("Enter First Number>> ");
            a = int.Parse(Console.ReadLine());
            Console.Write("Enter Second Number>> ");
            b = int.Parse(Console.ReadLine());

C Sharp Switch Case Tutorial

C # Switch Case Program

 class Program
    {
        static void Main(string[] args)
        {
            int i;
            Console.Write("Enter day of the week>> ");
            i=int.Parse(Console.ReadLine());
            switch(i)
            {
                case 1: