C语言中p=(1+r)的N次方怎么表示

就是C语言程序设计中第2章第一题

使用pow( )函数即可实现,示例代码如下:

#include <stdio.h>
#include <math.h>

int main()
{
double i = 0 ;

i = pow(2,3);   //将2的3次方赋给i

printf("%lf\n",i);

return 0;
}

输出结果:

温馨提示:内容为网友见解,仅供参考
第1个回答  2010-03-11
需要包含数学库
#include <math.h>
pow((1+r),N)
@para1 底数
@para2 指数本回答被提问者采纳
相似回答