C Program to caluclate power of number

C Program to caluclate power of number 



#include
#include
void main()
{
float x,power=1,i;
int y;
clrscr();
printf("enter the base and power ");
scanf("%f%d",&x,&y);
for(i=1;i<=y;i++)
power*=x;
printf("\n%f raised to %d is %f",x,y,power);
getch();
}

No comments:

Post a Comment