Data Type 1
Data Type 1
Variable
• In computer programming, a variable is a named storage
location that can hold a value.
Declaration:
• Syntax: data_type variable_name;
Initialization:
• Syntax: data_type variable_name = value;
Assignment:
• Variables can be assigned values using the assignment
operator (=).
Naming Rules:
• Variable names must follow certain rules, depending on the
programming language.
• Typically, they can include letters, numbers, and
underscores, but they cannot start with a number.
Data Types:
• Variables have types (e.g., int, double, string), which
determine the kind of data they can store.
Constant
• A constant is a value that cannot be altered or modified
during the execution of a program.
C-Tokens
• Keywords:
• Identifiers:
• Constants:
• String Literals:
• Strings enclosed in double quotes, like "Hello, World!".
• Operators:
• Punctuation Symbols: