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

3-2运算符求余不成功

#include <stdio.h>

int main()

{

    int x,y;

    x = 10;

    y = -3;

    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%y=%d\n",x%y);  

    return 0;    

}


提问者:qq_沉迷学习_1 2017-09-21 17:06

个回答

  • HackerAG1711
    2017-09-21 17:37:17
    已采纳

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