text: Write a program to calculate pow ( x , n ) | C # program for the above approach ; Math . pow ( ) is a function that return floating number ; Driver code
code: using System ; public class GFG { public static int power ( int x , int y ) { return ( int ) Math . Pow ( x , y ) ; } static public void Main ( ) { int x = 2 ; int y = 3 ; Console . WriteLine ( power ( x , y ) ) ; } }