计算两数加、减、乘、除、取模

来源:互联网 发布:sql和core data 编辑:程序博客网 时间:2024/06/07 13:58
/* Calculation two integers + * - / % *//* Input: two integers *//* Output: the sam is:the difference is:the quotient is:the remainder is:*/#include<stdio.h>int main(){    int x,y;    printf("Please Enter two integers:");    scanf("%d%d", &x, &y);    printf("The sam is: %d\n", x+y);    printf("The difference is: %d\n", x-y);    printf("The product is: %d\n", x*y);    printf("The quotient is: %d\n", x/y);    printf("The remainder is: %d\n", x%y);    return 0;}


0 0