Skip to main content

Static Class in C sharp #

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

namespace ConsoleApplication14
{public static class math
 {
     public static int big(int a, int b)
    {
        if (a > b)
            return a;
        else
            return b;
     }
     public static int pow(int a, int b)
     {int i=0,pow=1;
     for (i = 0; i < b; i++)
         pow = pow * a;
     return pow;
     }
  }

    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Big is :"+math.big(100,102));
            Console.WriteLine("Power is: " + math.pow(2, 4));
            Console.ReadKey();
        }
    }
}

Comments

Popular posts from this blog

unix commands