Both method include in single program
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int a = 2, b = 4;
Console.WriteLine(" The power of given number is {0}",Math.Pow(a, b));
// Second method
int result= Fun(2, 6);
Console.WriteLine(" The power of given number is {0}", result);
Console.ReadKey();
}
private static int Fun(int a, int b)
{
if (b >= 1)
{
return (a * Fun(a, --b));
}
else
return 1;
}
}
}