Hello! I am not quite sure about the output of this program,meaning my calculation and the programs are diffrent.
public class test2 { public static void main(String[] args) { char c = 'd'; Out.println(++c % c--); } }
Now the value of 'd' in the ASCII table is 100 so what I think is happening in the program(the print stament) is the value of d is increased by one and than % with 100.So it should be 101%100 which should print out 1.But the program prints out 0 suggestion it was 100%100.What am I missing here? I know the first one is a preincrement meaning the value of c will be increased but does the modulo operation have precedence or? Some clearification would be great, thanks!