0% found this document useful (0 votes)
8 views

Computer fundamentals and C programming (Internal Notes)

Constants in C are immutable variables initialized at the start of a program, which can be defined using the 'const' keyword or the '#define' preprocessor. Identifiers represent names for various entities in C, with rules governing their formation, and can be categorized into internal and external identifiers based on their linkage. The C character set comprises 256 characters, including alphabets, digits, and special symbols, which are essential for constructing statements and expressions in C programming.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Computer fundamentals and C programming (Internal Notes)

Constants in C are immutable variables initialized at the start of a program, which can be defined using the 'const' keyword or the '#define' preprocessor. Identifiers represent names for various entities in C, with rules governing their formation, and can be categorized into internal and external identifiers based on their linkage. The C character set comprises 256 characters, including alphabets, digits, and special symbols, which are essential for constructing statements and expressions in C programming.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

1. What are Constants in C?

(4m)
As the name suggests, Constants are the variables whose values cannot be changed
throughout the execution of the program once they are initialized at the beginning of the
program. Constants are also known as literals. A number, a character, a string of characters,
an array, a structure, a union, a pointer, and an Enum can be set as a constant.

How to Use Constants in C?


In the C programming language, A variable can be used as a constant by the following
methods:

Using const keyword.


Using the #define preprocessor.
Before we start creating the constants, Let us have an insight into the different kinds of
Constants in C.
2. Explain in detail about Identifiers. (4m)
Identifiers in C language represent the names of various entities such as arrays, functions,
variables, user-defined data types, labels, etc.

An identifier is a type of string of alphanumeric characters that always begins with either an
alphabetic or underscore character.

There are specific rules to define the identifiers in C, and we can not use the already defined
keywords present in the C language as identifiers.

Types of Identifiers in C
There are two types of identifiers in C language.

Internal identifier
External identifier
External Linkage Process: When we write an implementation file (.c, .cpp, etc), the compiler
generates a translation unit. A translation unit is a source file that is the combination of both
implemented file and all the header files included in it.

Internal linkage refers to everything only in the scope of a translation unit. In contrast,
External linkage refers to a whole program that combines all the translation units (or object
files).

Internal identifier
Internal identifiers are the ones that are not used in any of the external link processes. Internal
identifiers, also known as internal names; include the names of local variables. The internal
identifier can be a local variable. It has at least 31 significant characters.

External identifier
External identifiers are the ones that are used in an external link process. These identifiers are
also known as external names; include function names and global variable names that are
shared between source files. The external identifier can be a name of the function or a global
variable.
It has at least 63 significant characters.

3. Character Set in C (8m)


As every language contains a set of characters used to construct words, statements, etc., C
language also has a set of characters which include alphabets, digits, and special symbols. C
language supports a total of 256 characters.

Every C program contains statements. These statements are constructed using words and
these words are constructed using characters from C character set. C language character set
contains the following set of characters...

Alphabets
Digits
Special Symbols
Alphabets
C language supports all the alphabets from the English language. Lower and upper case
letters together support 52 alphabets.

lower case letters - a to z

UPPER CASE LETTERS - A to Z

Digits
C language supports 10 digits which are used to construct numerical values in C language.

Digits - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9

Special Symbols
C language supports a rich set of special symbols that include symbols to perform
mathematical operations, to check conditions, white spaces, backspaces, and other special
symbols.
Special Symbols - ~ @ # $ % ^ & * ( ) _ - + = { } [ ] ; : ' " / ? . > , < \ | tab newline space
NULL bell backspace verticaltab etc.,

You might also like