java - Error - not a statement when I have already defined the variable I use -
it's giving me error "not statement" , can't understand why.
here's error telling me:
coolnumbers.java:17: error: not statement for(num; num <= meme; num++){ ^
here's (now updated) code:
import static java.lang.system.*; public class coolnumbers { int num = 6; int iscoolnum; int meme; public int meth(int meme){ for(num; num <= meme; num++){ if (num % 3 == 1 && num % 4 == 1 && num % 5 == 1 && num % 6 == 1){ iscoolnum++; } } return iscoolnum; } }
your loop:
for(num; num <= meme; num++){
should be:
for(; num <= meme; num++){
i assume num
not need initial value (since gave 1 when declared it). if does, need like:
for(num = 0; num <= meme; num++){
Comments
Post a Comment