ASCII Values

ASCII

  • ASCII stands for American Standard Code for Information Interchange.
  • It is a character encoding standard used for representing text and controlling characters on computers and other devices that use text.
  • It was developed in the early 1960s and is based on the English alphabet.
  • ASCII is a fundamental character encoding standard that has played a crucial role in the development of computing and text processing.
  • ASCII values range from 0 to 127 and are divided into the following categories:
    1. Control characters (0-31 and 127): Used for control purposes, such as tabs, line breaks, and bell sounds.
    2. Uppercase letters (65–90): A–Z
    3. Lowercase letters (97-122): a-z
    4. Digits (48–57): 0–9
    5. Punctuation marks and special characters (32-47, 58-64, 91-96, 123-126): !, @, #, $, etc.
  • ASCII values are used in computing and programming for various purposes, such as:
    1. Character representation
    2. String manipulation
    3. Data storage
    4. Encryption and decryption

Example:

#include <iostream>

using namespace std;

int main() 
{
   char ch = 98;
   cout << ch <<endl;
    return 0; 
}

The output of the program will be:
b

Here’s a brief explanation of the code:

  1. The char ch = 98 statement declares a character variable ch and assigns it the ASCII value 98.
  2. The cout << ch << endl statement prints the character represented by the ASCII value 98, which is ‘b’, to the console.
  3. The return 0 statement indicates successful execution of the program.

Problem on ASCII

Convert a small letter (lower case) to a capital letter (upper case).

Questions? : Reach Out