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 (
intis not allowed but
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.