Program to find the value of xn

Program:

#include<stdio.h>
#include<conio.h>
void main()
{
    int x, n, count = 1, sum = 1;
    clrscr();
    printf("Enter the value of x : ");
    scanf("%d", &x);
    printf("\nEnter the value of n : ");
    scanf("%d", &n);
    while(count <= n)
    {
        sum = sum * x;
        count++;
    }
    printf("\nThe power of %d^%d is : %d", x, n, sum);
    getch();
}

Output:

Enter the value of x : 2
Enter the value of n : 4
The power of 2^4 is : 16