Thursday, September 20, 2012

program to find the power of any number

it provides the Nth power for any number
#include<stdio.h>
#include<conio.h>
void main()
{
int x,n,i=0,s=1;
clrscr();
printf("Enter the x-value & nvalue\n");
scanf("%d%d",&x,&n);
while(i<n)
{
s=s*x;
i++;
}
printf("the the value is\n %d",s);
getch();
}

No comments:

Post a Comment