C Program to calculate power of number

C Program to calculate power of number



#include
#include
void main()
{
float x,power=1,i;
int y;
clrscr();
printf("enter the base and power values ");
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