Wednesday, 27 July 2016

C Sharp String Tutorial

C# String Tutorial

 class Program
    {
        static void Main(string[] args)
        {
            String str;
            Console.Write("Enter your string>> ");
            str = Console.ReadLine();

C Sharp Function Overload

C# Function Overload

class test
{
        public void sum()
        {
            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=a+b;
            Console.Write("\nA={0}\nB={1}\nSum={2}",a,b,c);
        }

C Sharp This pointer tutorial

C# This pointer tutorial

class test
    {
        int x, y;
        public test(int x, int y)
        {
            this.x = x;
            this.y = y;

C Sharp Static Class Tutorial

C# Static Class Tutorial

class testmath
    {
        public static int sum(int a, int b)
        {
            return a + b;
        }
        public static Boolean prime(int a)
        {
            int b;
            for (b = 2; b < a; b++)
            {
                if (a % b == 0)
                    break;