<< Chapter < Page | Chapter >> Page > |
26 capital letter of English alphabet : A, B, C, D, . . . . X, Y, Z
26 small letter of English alphabet : a, b, c, d, . . . .x, y, z
10 digits : 0, 1, . . . 9
Math operators : + - * / =<>
Other symbols : |, \, # , %, ~, . . . .
A keyword is an identifier which indicate a specific command. Keywords are also considered reserved words. You shouldn’t use them for any other purpose in a C program.
The most important keywords of Turbo C are
asm | auto | break | case | char | const | continue | default |
do | double | else | enum | extern | float | for | goto |
if | int | long | register | return | short | signed | sizeof |
static | struct | switch | typedef | union | unsigned | void | volatile |
while |
Identifiers or names refer to a variety of things : functions; tag of structures, union and enumerations; member of structures or unions; enumeration constants; typedef names and objects. There are some restrictions on the names .
Names are made up of letters and digit; The first character must be a letter. The underscore “_” count as a letter; sometime it is useful for improving the readability of long variable names. For example, name unit_price is easier to understand than unitprice . However, don’t begin variable names with underscore, since library routines often use such names.
Upper and lower case are distinct, so x and X are different names. Traditional C practice use lower case for variable names, and all upper case for symbolic constant.
Only the first 31 characters are significant.
Keywords are reserved: you can’t use them as variable names.
Example The following names are valid
i, x, b55, max_val
and the following names are invalid
12w | the first character is a digit |
income tax | use invalid character “ “ |
char | char is a keyword |
It is wise to choose variable names that are related to the purpose of the variable, for example, count_of_girls, MAXWORD.
Data is valuable resources of computers. Data may comprise numbers, text, images . . .
They belong to different data types.
In programming languages, a data type is a set of values and the operations on those values.
For example, int type is the set of 32-bit integers within the range -2,147,483,648 to 2,147,483,647 together with the operations described in the following table.
Operations | Symbol |
Opposite | - |
Addition | + |
Subtraction | - |
Multiplication | * |
Division | / |
Modulus | % |
Equal to | = = |
Greater than | > |
Less than | < |
… |
A data type can also be thought of as a constraint placed upon the interpretation of data in a type system in computer programming.
Common types of data in programming languages include primitive types (such as integers, floating point numbers or characters), tuples, records, algebraic data types, abstract data types, reference types, classes and function types. A data type describes representation, interpretation and structure of values manipulated by algorithms or objects stored in computer memory or other storage device. The type system uses data type information to check correctness of computer programs that access or manipulate the
data.
In general, a constant is a specific quantity that does not or cannot change or vary. A constant’s value is fixed at compile-time and cannot change during program execution. C supports three types of constants : numeric, character, string.
Notification Switch
Would you like to follow the 'Introduction to computer science' conversation and receive update notifications?