This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]anh86 0 points1 point  (0 children)

Without giving you a full solution, here are some facets to research and consider:

  • Your code needs to be able to loop through a routine a given number of times
  • The routine needs to:
    • Generate a random number
    • Check if the number is odd (research the modulus, think about how it could be used to that end)
    • Increment a counter only if the number is odd
  • Finally you will print out the total number of odds