11智能在线
新记
编写C语言程序,输入两个的正整数,求出它们的和、差、积、商。
如题所述
举报该文章
相关建议 2012-02-23
#include"stdio.h"
int main()
{
int a,b;
scanf("%d%d",&a,&b);
if(b==0)b=1;
printf("和%d\n",a+b);
printf("积%d\n",a*b);
printf("差%d\n",a-b);
printf("商%.2lf\n",a*1.0/b);
return 0;
}
温馨提示:内容为网友见解,仅供参考
当前网址:
https://11.t2y.org/zz/878v4vf2p.html
其他看法
第1个回答 2012-02-23
#include<stdio.h>
void main()
{
float x,y;
printf("please input a x and a y:");
scanf("%f%f",&x,&y);
printf("%f %f %f %f\n",x+y,x-y,x*y,x/y);
}
第2个回答 2012-02-23
太难了,我帮你问问百度!
第3个回答 2018-09-26
你确定stdio是引号
相似回答
大家正在搜
相关问题
本题要求编写C语言程序,计算2个正整数的和、差、积、商并输出...
C语言程序编写“输入两个整数,分别求他们的和、差、积、商、余...
C语言程序设计:输入两个整数,计算并输出它们的和、积、差、商...
编写一段程序,求两个整数123和456的和,差,积与商,并输...
编写C语言程序:输入2个非零整数求它们和、差、积、商并输出
用C语言编程:任意输入两个整数,求他们的和、差、积、商、、、...
编写C语言程序,输入两个不为0的实数,求出它们的和、差、积、...
编写一个C语言程序,通过控制台输入任意两个整数,计算出这两个...