这个程序给了我错误的答案,比如-88567.0000000000000我不知道什么是错的
#include<stdio.h>
#include<math.h>
main()
{
float voltage,current,result;
puts("hello please enter the voltage ");
scanf("%f",&voltage);
puts("\nhello please enter the current ");
scanf("%f",¤t);
result=calling(voltage,current);
// result from function calling
printf("the answer is %f",result); // display the result
getch();
}
float calling (float y,float x)
{
float ans;
ans=y+x;
return(ans);
}
答案 0 :(得分:1)
放原型
float calling (float y,float x);
在主
之前