how do i use the pow function in this coding...

#include<iostream.h>
#include<conio.h>
#include<math.h>
void main()
{
void area(int i);
void area(int a ,int b);
int a,b;
cout<<"enter two no:";
cin>>a>>b;
area(a,b);
}
void area(int i)
{
cout<<"\narea="<<i*i;
}

void area(int a,int b)
{

c=pow(a,b);
cout<<"\narea="<<c;
}

getch();
pow() must be doubles. c=pow(static_cast<double>(a), static_cast<double>(b));

But maybe a and b should be doubles in the first place?
Last edited on
Topic archived. No new replies allowed.