C++ Program to find ASCII value of a character


In this program, You will learn how to find ASCII value of a character in C++.


A - 65, B - 66 .....


Example: How to find ASCII value of a character in C++

Run it Now
#include<iostream>
using namespace std;

int main() {

    char str;
    cout << "Enter any Character :";
    cin>>str;

    cout << "\nASCII value is :" << int(str);

    return 0;
}

Output:

Enter any Character :A
ASCII value is :65