为什么下面的值不是15,而是零呢?#include <stdio.h>void main(){ int a=5,h=6; float s; s=0.5*a*h; printf("s=%d\n",s);}

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/11 17:26:12
为什么下面的值不是15,而是零呢?#include <stdio.h>void main(){ int a=5,h=6; float s;    s=0.5*a*h; printf("s=%d\n",s);}

为什么下面的值不是15,而是零呢?#include <stdio.h>void main(){ int a=5,h=6; float s; s=0.5*a*h; printf("s=%d\n",s);}
为什么下面的值不是15,而是零呢?
#include <stdio.h>
void main()
{
 int a=5,h=6;
 float s;
    s=0.5*a*h;
 printf("s=%d\n",s);
}

为什么下面的值不是15,而是零呢?#include <stdio.h>void main(){ int a=5,h=6; float s; s=0.5*a*h; printf("s=%d\n",s);}
别听那人瞎说,s=0.5*a*h;这个表达式里有0.5,那么系统会自动转化为浮点型
printf("s=%d\n",s);
这条语句错了,你的s是float类型应该用%f来输出
%d 是用来输出整型的(int类型)
改为:
printf("s=%f\n",s);

为什么下面的值不是15,而是零呢?#include <stdio.h>void main(){ int a=5,h=6; float s; s=0.5*a*h; printf("s=%d ",s);} 南极站的温度计为什么不是水银而是酒精呢? photo的复数形式为什么不是photoes而是photos呢 为什么电负性最小的不是钫,而是铯呢? 电动车的电瓶为什么不是并联使用而是串联呢? 伟大的反义词为什么不是平凡而是渺小呢? buy的现在分词为什么不是buyying?而是buying呢 羊毛为什么不是蛋白质而是纤维素呢? 羊毛为什么不是蛋白质而是纤维素呢? 物体所带电荷量最小值为什么不是零?它不带电荷不行吗.正负电荷刚好抵消''为什么不是零而是元电荷的大小 A是加速度增大的减速运动B是加速度增大的加速运动加速度不是看斜率的吗?那A的斜率不是大于零吗?为什么反而是减速运动,而B确实加速运动的呢? 为什么河南省的政治经济文化中心不是东都洛阳,不是汴京开封,而是郑州呢? 为什么不是in hurry,而是in a hurry hurry作名词时,是可数的吗? 为什么有的人的身份证号码最后一个数不是数字呢?而是字母呢! that后面的短语为什么不是fashion开头 而是was开头呢?I'd frayed the edges of my jeans as that was the fashion in those days 求困惑,下面题目为什么答案不是B,而是C, 山中访友3段写古桥为什么不是拟人,而是拟人呢?说错了,正确的问题是山中访友3段写古桥为什么不是拟人,而是比喻呢? 你不是说负数是小于零的数和零,那零为什么不可以说是负数呢?