減税作っているプログラムで余剰の動きがおかしいのですが、解決方法をご存知の方はおられますでしょうか?
###ソース
#include <stdio.h>
#define K (50)
int main()
{
...
int Remainder=0;
...
if (((K) % 5) != 0) { Remainder = K % 5; } else { Remainder = 0; }
...
return 0;
}
Visual Studioのウォッチを見るとなぜかこの式でRemainderの中身が15になっています。
50/5で余りは0のはずなのですが、上手くいかない理由ないしは解決法をお願いします。
剰余ですね。
回答3件
あなたの回答
tips
プレビュー