ASCII Code for Characters in C++ program Source Code

In this tutorial, I would like to post a visual c++ console application source for a program that displays ASCII values as a table. It will be helpful in basic programming to detect the input character. You can compile this program using visual c++ or other compilers. ASCII is a set of special type of codes that will distinguish characters in computer memory. But because of its less capability for maintaining more characters and symbols, now it is replaced by UNICODE.

C program to print ASCII code and corresponding character


using namespace std;

void main() {

  char ch = '60';
  int counter = 60;
  while (counter < 137) {
    cout << "ASCII Code for " << ch << " is " << 'ch' << "n";


ASCII Table and Description

ASCII stands for American Standard Code for Information Interchange. Computers can only understand numbers, so an ASCII code is the numerical representation of a character such as ‘a’ or ‘@’ or an action of some sort. ASCII was developed a long time ago and now the non-printing characters are rarely used for their original purpose. Below is the ASCII character table, and this includes descriptions of the first 32 non-printing characters. ASCII was actually designed for use with teletypes and so the descriptions are somewhat obscure. If someone says they want your CV however in ASCII format, all this means is they want ‘plain’ text with no formatting such as tabs, bold or underscoring – the raw format that any computer can understand. This is usually so they can easily import the file into their own applications without issues. Notepad.exe creates ASCII text, or in MS Word you can save a file as ‘text only’

ASCII Full Character Set

Ascii Full Character Set

Extended ASCII Codes

Extended ASCII codes

Muhammed Afsal Villan is an experienced full-stack developer, specialized in desktop and mobile application development. He also regularly publishes quality tutorials on his YouTube channel named 'Genuine Coder'. He likes to contribute to open-source projects and is always enthusiastic about new technologies.