关于网友提出的“ 一个数学函数调用的问题”问题疑问,本网通过在网上对“ 一个数学函数调用的问题”有关的相关答案进行了整理,供用户进行参考,详细问题解答如下:
问题: 一个数学函数调用的问题
描述: 我想调用cos函数求一个数的余弦函数,该怎么编写程序呢?
我写的是
# include
# include
int main()
{
printf("%f"cos(3.5678));
getch();
}
但是错了 该怎么调用呢?
求高人指点呀!
解决方案1:
# include
# include
int main()
{
printf("%f",(float)cos(3.5678));
getchar();
}
double cos(double _x);
float cos(float _x);
long double cos(long double _x);
注意类型。
以上介绍了“ 一个数学函数调用的问题”的问题解答,希望对有需要的网友有所帮助。
本文网址链接:http://www.codes51.com/itwd/2221080.html