Hello everyone. I started learning Java just now and right now writing simple codes. Made a program, where it displays all the numbers from the range 1 - 100 which are divisible by 5
// beginning from 100 (in reverse order).
I just have a question about this line of code:
if (i % 5 == 0) {
System.out.print(i + " --NEXT-- ,");
It prints 100 NEXT, 95 NEXT and so on, but what does == (equality operator) and 0 in the end really mean. Can someone explain it to me really simple? Also, when does 0 turn to 1 after ==? Does 0 turn to 1 if for example i is 101 and it goes i % 5==1 because 101 divided by 5 is 20 and 1 is leftover?
Kind Regards,
Squish