问答详情
源自:3-2 算术运算符

运行成功输出错误咋办

运行结果中老是没有x%y=1咋办

提问者:甄诚的允诺 2018-10-17 17:42

个回答

  • jmmoeg
    2018-10-17 18:04:37

    #include <stdio.h>

    int main()

    {

        int x,y;

        x = 10;

        y = -3;

        char ch = 37;

        printf("x+y=%d\n",x+y);  

        printf("x-y=%d\n",x-y);

        printf("x*y=%d\n",x*y);

        printf("x/y=%d\n",x/y);

        printf("x%cy=%d\n",ch,x%y);  

        return 0;    

    }