×

Character Set in C

Introduction

Every language has some basic elements which are used to represent information. The English language includes alphabets which together shape a sentence, after which the sentences are used to shape a paragraph.

Like every language, C also contains a set of characters which are used to represent information. The set of characters in C included alphabets, digits and special symbols. The language supports 256 characters in total.

Every program in C language consists of statements. The statements contain words, and the words are further constructed using characters from characters set in C.

The character set in C consists of the following set of characters:

  1. Alphabets
  2. Digits
  3. Special Symbols

Note: The characters set in C are both machine and user readable since they are from human understandable language.

Need of Characters

Every language has some basic elements which are used to represent information. The English language includes alphabets which together shape a sentence, after which the sentences are used to shape a paragraph, similar to this, a combination of different types of characters forms a program. The characters are building blocks to write a program.

Classification of Characters in C

The characters in C are classified into two types:

Source Characters

 

Alphabets

Digits

Special characters/symbols

White Spaces

Execution Characters

 

 

Source Characters

1) Alphabets:

The alphabets in ANSI C are the same as alphabets in the English language. Every alphabet in the english language is supported by the C language too and, this includes both upper and lowercase letters which together sums upto 52 alphabets.

  1. Lowercase letters - a to z
  2. Uppercase letters - A to Z

Note: The lowercase (small letters) and uppercase (caps letter) are distinct in the C programming language.

2) Numerical Digits:

The C language supports a total of 10 digits. These digits lie in the range from 0 to 9 and are used to construct numerical values.

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

3) Special Symbols:

There are various types of special symbols supported by the C language. This rich set of special symbols includes symbols to perform;

  • Mathematical operations
  • Condition checking
  • White spacing
  • Backspaces

The following are the special characters contained by the C language language with their symbols and meaning:

Symbol   Meaning  
 ~ Tilde
 !Exclamation mark
 $Dollar sign
 #Number sign
Lest parenthesis
 )Right parenthesis
_Underscore 
 +Plus sign
%Percent sign 
 ^Caret
 &Ampersand
  *Asterisk
 | Vertical bar
  \ Backslash
 ` Apostrophe
 " Quotation mark
 ; Semicolon
 < Opening angle bracket
 > Closing angle bracket
  ? Question mark
 , Comma
 .Period
  / Slash
 - Minus sign
 = Equal to sign
  { Left brace
  } Right brace
 [ Left bracket
] Right bracket
 :  Colon
 - Minus sign

Execution Characters

The execution characters in C are the characters which are invisible on the display window or console. The execution characters are related to ASCII values which are understood by the computer when a certain command is passed to the computer.

Conclusion

Every language has some basic elements which are used to represent information. Like every language, C also contains a set of characters which are used to represent information.

Character Set in C language

Alphabets : a to z and A to Z
Digits :        0,1,2,3,4,5,6,7,8,9
Symbols :   ~, &, %, $, *, ^
Space :       Blank, back, tab etc

Related Topics

Calloc in C

The calloc() is a library function in C which is used for memory allocation. The calloc() function dynamically allocates multiple blocks of memory to complex data structures. This includes data structures...

3 minutes read.

Dos.h Header File in C Language

Dos.h is a header file in C. Interrupt handling, sound generation, date and time functions, and other tasks can be performed using the functions in this library. This is exclusive to...

4 minutes read.

Nested if-else statement in C

If we use an if-else statement within another if statement in a C program, it is called a nested if-else statement in C. It helps to check the condition inside...

3 minutes read.

Banker’s Algorithm in C

Introduction Before doing a "s-state" check to look for potential activities and deciding if allocation should be allowed to continue, the banker's algorithm, a resource allocation and deadlock avoidance algorithm, tests...

5 minutes read.

Exponential() in C

Introduction: In C language, there are available many types of functions. The exponential() function is one of them. It is a mathematical function. This article describes using the pow() property to...

3 minutes read.

Conio.h in C

Header files are the source files with the extension of .h. In c language header files are referred to as the helping files and they contain definitions of various functions...

4 minutes read.

How to create a binary file in C?

Creating a binary file in C language is very simple, requiring only some specific functions to be implemented. There are also other binary modes: read, and write, which will be...

7 minutes read.

Types of Array in C

What is an Array? One value can be stored in a variable at once. How many variables will you need if you have 100 values? Well, the answer isn't 100. It...

14 minutes read.

Else If Ladder in C

What is Else If Ladder: When there are multiple options and a user has to decide from the options, we use Else If Ladder. Basically, it is an extension of if...

3 minutes read.

7 Best IDEs for C/C++ Developers in 2024

As we all know that in programming languages, C is known as the building block which cannot be contradicted, and C++ is the prolong kind of C and it can...

4 minutes read.

Bubble sort in C

Bubble sort in C Bubble sort is defined as the algorithm that is used for the sorting mechanism. It follows the technique of replacing the first index with the more minor...

4 minutes read.

Operators in C

An operator is a special symbol that tells the compiler to perform specific mathematical or logical operations. It is the combination of constants and variables through expressions. Example: int c = a+b*5 Where,...

5 minutes read.

How to Merge Array in C?

Introduction Merging arrays is a common task for many developers but might be difficult for beginners of C programming. Fortunately, our guide will show you how to quickly merge arrays in...

6 minutes read.

Difference between while and for loop in C

While Loop The syntax that can be used for the ‘while’ loop in the C programming language is mentioned below: while (test expression or termination condition)  {   // the main body of the...

6 minutes read.

Escape Sequence in C

An escape sequence is a sequence of character that used inside the string literal or character.  All the escape sequence is used with the backslash (\) symbol. The list of an...

1 minute read.

Actual and Formal Parameters

Any variable declared within the parenthesis is referred to as the parameters during the function declaration. Parameters tell the function about the argument datatype, their order, and the number of...

5 minutes read.

Find a subarray with a given sum.

Find a subarray with a given sum. The simple solution is to recognize all subarrays one by one and to check each subarray's sum. The quick solution follows the following program. Algorithm: From...

4 minutes read.

Compilation Process in C language

What is the Compilation Process?  The compilation is a method whereby the source code is converted into object code. It is achieved with compiler assistance. The compiler tests the source code for syntactic...

3 minutes read.

First Fit Program in C

This is one of the easiest ways to allocate memory. The main goal is to divide the memory into several fixed sizes. In C, there is only one process for...

3 minutes read.

Find the Largest Three Distinct Elements in an Array using C/C++

In this tutorial, we will demonstrate how to use a C/C++ programme to locate the highest three different elements in an array. C/C++ Program to Find the Largest Three Different Elements...

3 minutes read.