Feb 22, 2012 at 6:24pm UTC
Hello,
plz help in this problem.
plz provides me pow(); defination .In borland turbo c 3.0 math.h contains only function Declaration any one tell me where is Defination of function,
Feb 22, 2012 at 6:27pm UTC
Your attempt at a request is illegible.
Feb 22, 2012 at 6:30pm UTC
Oh wait, I understand. You see the declaration in the header, but want to know what's in the source...
That's contained in a pre-compiled library that comes with your compiler. It is already in a binary format which is linked automatically by your borland turbo compiler and source code is generally not available.
Feb 23, 2012 at 3:28am UTC
Stewbond thanx for answer.
please help in make a porgrame.
e.g
#include<conio.h>
#include<iostream.h>
int power(int x,int p)
{
int ans,i;
ans = 1;
for(i = 0; i < p; i++)
ans *= x;
return ans;
}
int main()
{
clrscr();
int b,p,c;
cout<<"Enter a Base & Power";
cin>>b>>p;
c=power(b,p);
cout<<c;
getch();
}
it's works.
But how create pow(); Function for real numbers.
double power(double x,double p)
{
double ans,i;
ans = 1;
for(i = 0; i < p; i++)
ans *= x;
return ans;
}
double main()
{
clrscr();
double b,p=1.0/2.0,c;
cout<<"Enter a Base & Power";
cin>>b;
c=power(b,p);
cout<<c;
Not works it reurn same value.
Here is worng use of for loop.how to use correct
i'm wanted a pow function to any number whose power is 1/2;
e.g (4)^1/2=2,
(81)^1/2=9
Feb 23, 2012 at 8:36am UTC
plz help me in create my own power(); function
how work with real number as works pow builtin function