Troubleshooting a Boolean Expression Incrementing By 10

  • Thread starter Thread starter Mindscrape
  • Start date Start date
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 2K views
Mindscrape
Messages
1,854
Reaction score
1
I am trying to make a table that will output a value every ten years. Basically, I am incrementing the year by 1 in a while loop, and I want it so every time year=10, 20, 30... that it will output a value. I have:

if (year%10 == 0) {
... code
}

For some reason the compiler has trouble compiling this.

*Nevermind, I had a typo and forgot the second =.
 
Last edited:
Physics news on Phys.org