Character Set in C | Character Set in C Programming Language | C Character Set

 A character set in C programming language is the set of all valid characters that can be used in source program to represent information. The character set helps in defining the valid characters that we can use in source program for forming words, expressions and numbers.

Just like we use a set of various words, numbers, statements, etc., in any language for communication, the C programming language also consists of a set of different types of characters. These are known as the character set in C. They include alphabets, digits, special symbols etc.

 

Types of Characters in C:

The C programming language provides support for the following types of characters.

·    Letters or Alphabets
·    Digits or Numbers
·    Special Characters
·    White Spaces
 

All of these serve a different set of purposes, and we use them in different contexts in the C language.

 

Letters or Alphabets:

The C programming language provides support for all the alphabets that we use in the English language. Thus, in simpler words, a C program would support a total of 52 different characters- 26 uppercase and 26 lowercase.

 

Type of Character

Description

Characters

Lowercase Alphabets

a to z

a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z

Uppercase Alphabets

A to Z

A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z

 

Digits or Numbers:

 

The C programming language provides the support for all the digits that help in construct the numeric values or expressions in a program. These range from 0 to 9 and also help in defining an identifier.

Thus, the C language supports a total of 10 digits for constructing the numeric values or expressions in any program.

 

Type of Character

Description

Characters

Digits

0 to 9

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

 

 

Special Characters:

 

C language supports a rich set of special character for some special purposes, such as logical operations, mathematical operations, checking of conditions etc.

We can also use these characters for defining the identifiers in a much better way. For instance, we use underscores for constructing a longer name for a variable, etc.

The C programming language provides support for the following types of special characters:

Character

Description

Character

Description

,

Comma

&

Ampersand

.

Period

^

Caret

;

Semicolon

*

Asterisk

:

Colon

Minus sign

?

Question Mark

+

Plus sign

Apostrophe

Less than

!

Exclamation

Greater than

|

Vertical Slash

=

Equal to

/

Slash

(

Left parenthesis

\

Back slash

)

Right parenthesis

Quotation mark

[

Left square bracket

~

Tilde

]

Right square bracket

_

Underscore

{

Left curly bracket

$

Dollar Sign

}

Right curly bracket

%

Percentage sign

#

Number sign(hash)

 

 

White Spaces:

The white spaces in the C programming language contain the following:

  •  Blank Spaces      
  • Carriage Return    
  •  Horizontal Tab
  •  New Line
  •  Form Feed

 

 

 

 

Leave a Comment