How can I use a variable as a power in C++

for example an equation n^n
should pow(n ,n) work?

I have a program for a class where a variable FIRST is the first number inputted from a file. I need to then work out the factorial using the equation
n! = e^(-n)*(n^n)*sqrt(2 *pi*n)

Using FIRST as my variable instead of N I came up with the following equation:
FACTORIAL = (((pow(2.718281 83,...