计算两数的和与差的代码c语言
时间: 2023-03-12 12:46:09 浏览: 2035
宋鑫诚c++项目2作业-----求两数和与差
计算两数的和和差的C语言代码如下: int main(){
int a,b;
int sum,diff;
scanf("%d %d",&a,&b);
sum = a + b;
diff = a - b;
printf("%d + %d = %d\n",a,b,sum);
printf("%d - %d = %d\n",a,b,diff);
return 0;
}
阅读全文