C语言pow函数

pow(x,y);//其作用是计算x的y次方。x、y及函数值都是double型 

例:
我要计算2的5次方
源代码如下:
#include"stdio.h"
#include"math.h"
main()
{
long total;
int x = 2, y = 5;
total = pow(x,y); /*调用pow函数*/
printf("%ld",total);
getch();
}
posted @ 2018-04-19 14:00  cobblestone_Rong  阅读(2450)  评论(0)    收藏  举报