We are going to start with the second part of our variable declaration, type variable_name, the variable_name. C does not allow you to throw anything down and call it a variable name, there are some restrictions.

  • Names can be composed of upper and lower case letters, numbers, and underscores.
  • The first character must be a letter (upper or lower case).
  • No keywords are allowed as the full name (int is not allowed but int_count would work).

That’s it, nothing too crazy, just keep those rules in mind when you are creating your names for your variables.



The code on the right has errors in each of the variable declarations. Look at the rules for variable names above and fix each of them so that there is one variable declaration per line and the code compiles.

When complete you will see "Hello World" in the output window.

Take this course for free

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?