WARNING: This program has a logic error. It doesn't cause an error message, but something isn't quite right.

  • Click Run and enter a number less than 24. Look at the code. What's wrong with the output?
  • Fix the program by replacing one division operator ( / ) with the modulo operator ( % ).
  • Click Run once you've fixed the program and verify that the output is correct.
  • Click Submit and Next when you're ready to move on.

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)