In this example, You learn about C++ program for find ASCII value of a character.
Here you learn find ASCII value in C++, You are given a character and the task of the program to find ASCII value of a character.
C++ Program to find ASCII value of a Character
#include <iostream>
using namespace std;
int main() {
char ch,c;
int cha;
cout<<"Enter a character: ";
cin>>ch;
cha=ch;
cout<<"\n ASCII value of "<<ch<<" is "<<cha;
return 0;
}
OutputEnter a character: F ASCII value of F is 70
Tags:
C++