DEMO: In this interactive activity, you'll learn about how we use casting to change a variable's data type!

Casting is the process of converting the data type of a variable or value from one type to another. You can change a string to an integer, an integer to a string, an integer to a float (decimal number), and more!

  • Click Run to see the animation. Follow the instructions on the stage to complete the activity.
  • When you're finished, click Submit and Next 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)