Home › Forums › JavaScript › Code Academy help… › Re: Code Academy help…
December 6, 2012 at 11:31 am
#116529
tbwiii
Participant
I think you want to do
if(i % 2) {
print i*i;
}
It checks to see if there’s a remainder from i divided by 2. If there is then i is odd. If it is odd then square it.