Lesson 2 Flashcards
(8 cards)
is a container (storage area) to hold data.
Variable
are data used for representing fixed values. They can be used directly in the code.
Literals
Rules for naming a variable
• A variable name can only have letters (both uppercase and lowercase letters), digits and
underscore.
• The first letter of a variable should be either a letter or an underscore.
• There is no rule on how long a variable name (identifier) can be. However, you may run into
problems in some compilers if the variable name is longer than 31 characters.
a numeric literal (associated with numbers) without any fractional or exponential part.
Integers
three types of integer literals in C programming:
- decimal (base 10)
- octal (base 8)
- hexadecimal (base 16)
a numeric literal that has either a fractional form or an exponent form.
Floating-point Literals
is a sequence of characters enclosed in double-quote marks.
String Literals
created by enclosing a single character inside single quotation marks
Floating-point Literals