Without using string manipulation (checking for an occurrence of the . or , character) by casting the product of an int calculation to string.
.
,
Use the modulus (%) operator:
%
6 % 3 == 0 7 % 3 == 1