Advertisement

C++ Program to print character using ASCII value


In this program, You will learn how to print character using ASCII value in C++.


A - 65, B - 66,  C - 67, D - 68

Example: How to print character using ASCII value in C++

#include<iostream>
using namespace std;

int main() {

    int asc;
    cout << "Enter a ASCII value:";
    cin>>asc;

    cout << "Character value is:" << char(asc);

    return 0;
}

Output:

Enter a ASCII value:68
Character value is:D