编写一个函数fun,然后设计主函数调用函数fun。函数fun的功能是:求两数平方根之和,作为函数值返回。例如:输入12和20,输出结果为:y=7936238

编写一个函数fun,然后设计主函数调用函数fun。函数fun的功能是:求两数平方根之和,作为函数值返回。例如:输入12和20,输出结果为:y=7936238

#include<stdio.h>
#include<math.h>
float fun(int a,int b)
{
float c;
c = sqrt(a)+sqrt(b);
return c;
}
int main()
{
int a=12,b=20;
float c;
c = fun(a,b);
printf("%f",c);
return 0;
}
您好,我是有问必答小助手,您的问题已经有小伙伴帮您解答,感谢您对有问必答的支持与关注!
PS:问答VIP年卡 【限时加赠:IT技术图书免费领】,了解详情>>> https://vip.csdn.net/askvip?utm_source=1146287632