发布网友
共2个回答
热心网友
t
x,
float
y);
用法:#include
功能:计算x的y次幂。
说明:x应大于零,返回幂指数的结果。
举例:
//
pow.c
#include
#include
main()
{
clrscr();
//
clear
screen
textmode(0x00);
//
6
lines
per
LCD
screen
printf("4^5=%f",pow(4.,5.));
getchar();
return
0;
}
另外,团IDC网上有许多产品团购,便宜有口碑
热心网友
原型:在TC2.0中原型为extern
float
pow(float
x,
float
y);
,而在VC6.0中原型为double
pow(
double
x,
double
y
);
头文件:math.h
功能:计算x的y次幂。
返回值:x应大于零,返回幂指数的结果。
举例1:(在VC6.0中运行通过)
#include
#include
int
main(void)
{
double
x
=
2.0,
y
=
3.0;
printf("%lf
raised
to
%lf
is
%lf\n",
x,
y,
pow(x,
y));
return
0;
}
举例2:
(在TC2.0中运行通过)
//
pow.c
#include
#include
main()
{
clrscr();
//
clear
screen
textmode(0x00);
//
6
lines
per
LCD
screen
printf("4^5=%f",pow(4.,5.));
getchar();
return
0;
}