c语言中根号怎么打

如题所述

首先在 main()函数 上边加个#include "math.h" 因为开根号属于 数学函数里边的函数,要使用根号就要加上#inculde "math.h",\r\n然后在你要开根号的数的前边加个 sqrt,就可以了 \r\n例如\r\n#inculde "math.h"\r\nmain()\r\n{ float a,b;\r\n printf("please input a nuberm:");\r\n scanf("%f",&a);\r\n b=sqrt(a);\r\n printf("%f\n",b);\r\n \r\n}这个程序就是 让 用户输入个数字,然后输出原数值的开根号后的结果
温馨提示:答案为网友推荐,仅供参考
第1个回答  2018-02-02
没法打根号,用函数来实现的
下面是一个例子,你看一下
#include <math.h>
#include <stdio.h>
int main()
{
printf("%lf", sqrt(3.5));
}本回答被网友采纳
相似回答