Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Code Academy help… Re: Code Academy help…

#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.