[Solved] How to do modulo calculation? [closed]


Modulo arithemtic means that you should use corresponding remainder, not the value itself.
In your case:

  5 + 25 (mod 26) == 30 % 26 == 4 // <- "%" is taking remainder after dividing on 26

Whatever operation you do in mod 26, the answer will be in 0..25 range.

Sample code (C#):

  int x = 5;
  int y = 25;
  int mod = 26;
  int result = (x + y) % mod;

solved How to do modulo calculation? [closed]