Best Practice For Variable, Constant And Keywords In C
simply in the programming the alphabets, digits and special symbols when properly combined form constants, variable and keywords.
A Constant is an entity that doesn't change, whereas, a variable is an entity that may change. A keyword is a word that carries special meaning.
Keywords are the words whose meaning has already been explained to the C compiler.
Rule for Constructing Integer Constant:
๐in integer constant must have at least one digit.
๐it can be any zero, positive or negative.
๐the allowable range for integer constant is -2147483648 to +2147483647.
Note: No commas and blanks are allowed and if no sign precedes, it is assumed to be positive.
Rule for Constructing Real Constant:
๐A real constant must have at least one digits.
๐it must have a decimal point.
๐it could be either positive or negative.
๐it must have a decimal point.
๐it could be either positive or negative.
Note: No comma and blanks allow and Default sign is positive
Rule for Constructing Character Constant:
๐A character constant is a single alphabet, a single digit or a single symbol enclosed within a single inverted comma.
๐Example: 'a'.
๐Example: 'a'.
Note: both inverted commas should point with the left.
Rule for Constructing Variable Names:
A variable name is any combination of alphabets, digits and underscores.
the first character in the variable name must be an alphabet or underscore.
no commas, no blanks or no special symbol other than underscore.
the first character in the variable name must be an alphabet or underscore.
no commas, no blanks or no special symbol other than underscore.
Comments
Post a Comment