Wednesday 27 July 2016

C Sharp Class Basics Tutorial

C# Class Basics Tutorial

class student
    {
        int roll;
        string name;
        string city;
        public void setdata(int r, string n, string c)
        {
            roll = r;
            name = n;
            city = c;

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());