#include<stdio.h>
float pow(int m,int n)
{
int i=1;
float result=1.0;
if(n<0)
{
while(n!=0)
{
result=result*(1.0/m);
n++;
}
}
else
{
if (n=0)
result=1;
else
while(i<=0)
{
result=result*m;
i++;
}
}
return result;
}
void main()
{
int base,po;
float result;
printf("Enter the value of base and power");
scanf("%d %d",&base,&po);
result=pow(base,po);
printf("%f",result);
}
0 Comments
If you have any problem in code write in comments!