浮点型变量除法问题
程序如下dio.h>
#include <st
int substrat (float x ,float y);
/*this is my program.*/
int main()
{
float a,b,sum;
a=12.00;
b=24.00;
sum=substrat(a,b);
printf("sum=%f\n",sum);
return 0;
}
/*this function calculate the sum of x and y*/
int substrat (float x ,float y)
{
float z;
z=x/y;
return (z);
}
最终输出结果为SUM=0.000000,咋回事捏??????????