• Post Reply Bookmark Topic Watch Topic
  • New Topic

For Loop  RSS feed

 
Junaid Mahmud
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my program I only want the code to be executed If the number of months Is less than 12 however the for loop still prints out the out put if the number of moths is greater than 12. Please Thanks!


 
Knute Snortum
Sheriff
Posts: 4276
127
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You seems to be reusing the variable month:
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!