当前位置: > 在C语言中,10的n次方怎么表示?...
题目
在C语言中,10的n次方怎么表示?

提问时间:2020-11-15

答案
有两个函数可以实现,double pow(double x,double y),double pow10(int p)
下面是这两个函数的使用方法,个人建议用:pow10(n)
函数名:pow
功 能:指数函数(x的y次方)
用 法:double pow(double x,double y);
程序例:
#include
#include
int main(void)
{
double x = 2.0,y = 3.0;
printf("%lf raised to %lf is %lf ",x,y,pow(x,y));
return 0;
}
函数名:pow10
功 能:指数函数(10的p次方)
用 法:double pow10(int p);
程序例:
#include
#include
int main(void)
{
double p = 3.0;
printf("Ten raised to %lf is %lf ",p,pow10(p));
return 0;
}
举一反三
我想写一篇关于奥巴马的演讲的文章,写哪一篇好呢?为什么好
奥巴马演讲不用看稿子.为什么中国领导演讲要看?
想找英语初三上学期的首字母填空练习……
英语翻译
1,人们染上烟瘾,最终因吸烟使自己丧命.
版权所有 CopyRight © 2012-2019 超级试练试题库 All Rights Reserved.