Modulo operator with .size() function
Recently I discovered that if I using the mod operator with a negative number and .size() gives me some unexpected outputs…
why does the value of n increases by one in in first iteration while the result of (n+1)%26 is 0.26
in line 10, n = (n + 1) % 26; the value of n should be 0.26 in first iteration as it has not been rounded up or rounded down so why has the value of n increased by one ?? I don’t understand this part can any one explain? much appreciated.