作业帮 > 综合 > 作业

C语言中的幂函数··怎么写~老师没教过·

来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/10 13:48:18
C语言中的幂函数··
怎么写~老师没教过·
原型:extern float pow(float x, float y);

用法:#include <math.h>

功能:计算x的y次幂.

说明:x应大于零,返回幂指数的结果.

举例:
// pow.c

#include <stdlib.h>
#include <math.h>
#include <conio.h>
void main()
{
printf("4^5=%f",pow(4.,5.));
getchar();
}

相关函数:pow10