What is Character set



A Character denotes any alphabets, digits and special symbols used to represent information 
for Example
alphabets A,B...Y,Z Or a,b...y,z
Digits 0,1,2,3,4,5,6,7,8,9
Special symbols `~ !@#$%^&*()_+-=}{|":<>?/.,;'\][


 Constants, variables and keywords

The alphabets, digits and special symbols when properly combined from constants, variable and keywords. A constants 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.

In any C program, we typically do lots of calculations. The result of these calculation are store in memory of computer, Like human memory, the memory of computer also consists of millions of cell. The calculated value are store in the brain. That way computer are calculation store in memory ( as hard disk etc). Since the value stored in each locations may change.

In programming language, constants are often called literals, whereas variable are called identifiers.

we understand the constants and variable, let us see.

What different types of constants and variables in C

Types of constants in C


constants in C can be divided into two major categories:

  1. ) Primary constants
  2. ) Secondary constants

Primary constants Secondary constants
Integer constants
Real constants
Character constants
Array
Pointer
Structure 
Union 
Enum etc.
Rules for constructing integer constants

 a). An integer constants must have at least one digits.
 b). It must not have a decimal point.
 c). It can be any of zero, positive or negative. 
d). If no sign precedes an integer constants, it is assumed to be positive .
 e). no commas or blanks are allowed within an integer constant. 
f). The allowable range for integer constants is -2147483648 to +2147483648. 

Truly speaking, the range of an integer constant depends upon the compiler. for compilers such as Visual Studio, GCC, it is -2147483648 to +2147483647, Whereas for compilers such as turbo c or turbo c++, the range is -32768 to +32767. 

Rules for Constructing Real Constants

 Real constants are often called foating point constants. Real constants could be written in two forms fractional form and exponential form. following rules must be observed while constructing real constants expressed in fractional form :

 a) A real constant must have at least one digit. 
 b) It must have a decimal point.
 c) It could be either positive or negative.
 d) Default sign is positive.
 e) No commas or blanks are allowed within a real constant. 

for example:-
+345.45
90.09
-67.78
-767.89685

 


Comments