## Introduction

The library function pow() is used to determine the power of any base; it is defined in the math.h header file.

We'll read X as the base and N as the power in this article, then calculate the result (X^{N} - X to the power of N).

So, letâ€™s get started:

Also Read, __Binary to Hex Converter__ and __C Static Function____.__

## Problem Statement

Write a C program to input any two numbers x and n and find their power(x^{n}) using the inbuilt pow() function.

### About POW()

The pow() function calculates a number's power. The pow() function accepts two arguments (base and power) and returns the power raised to the base number.

In the math.h header file, the pow() function is defined.

Let's understand with an example:

### Implementation

```
/* C program to find power of a number ( x^n ) using pow function */
#include <stdio.h>
#include <math.h>
void Solve()
{
int x,n;
int ans;
printf("Enter the value of base: \n");
scanf("%d",&x);
printf("\nEnter the value of power: \n");
scanf("%d",&n);
ans =pow((double)x,n);
printf("\n%d to the power of %d is= %d", x,n, ans);
}
int main()
{
Solve();
return 0;
}
```

Output:

#### Try it on the C compiler for a better understanding.

#### Program Explanation

The library function pow(), defined in the â€śmath.hâ€ť header file, is used to compute mathematical functions in this C application. Using the 'x' and 'n' variables, we read two integer values and feed them to the power() function to compute X^{N}.

#### Complexity Analysis

**Time Complexit**y: O(log(N))

**Space Complexity**: O(1)

You can also read about __dynamic array in c____ __and __Tribonacci Series____.__