C语言 编写一个程序输入 2 个数输出这 2 个数的商;注意除数不能为 0
#include <stdio.h>
int main() { int num1, num2, quotient;
printf("请输入两个数:\n");
scanf("%d %d", &num1, &num2);
if (num2 == 0) {
printf("除数不能为0\n");
} else {
quotient = num1 / num2;
printf("两个数的商为:%d\n", quotient);
}
return 0;
}
原文地址: https://www.cveoy.top/t/topic/iQx7 著作权归作者所有。请勿转载和采集!