花鸟字作品 | 花鸟字知识 | 加入收藏 花鸟字转换器软件可转换多种花鸟字在线预览 网页版 V2.0
花鸟字转换器

当前位置:花鸟字网 > 知识库 >

c语言根号

时间:2024-01-29 22:02:50 编辑:花鸟君 来源:花鸟字网

c语言中没有根号。

首先在 main()函数 上边加个#include "math.h" 因为开根号属于 数学函数里边的函数,要使用根号就要加上#inculde "math.h"

然后在你要开根号的数的前边加个 sqrt,就可以了

例如

#inculde "math.h"

main()

{ float a,b

printf("please input a nuberm:")

scanf("%f",&a)

b=sqrt(a)

printf("%fn",b)}这个程序就是 让 用户输入个数字,然后输出原数值的开根号后的结果

Copyright:2014-2023 花鸟字转换器 www.93203.com.cn All rights reserved.