ASCII CODE
ASCII stands for American Standard Code for Information Interchange. Computers can only understand binary numbers, so an ASCII code is the numerical representation of a character.
//Program to display the ASCII value of given character
#include <iostream>
using namespace std;
int main()
{
int num;
char ch;
cout<<"ENTER CHARACTER: ";
cin>>ch;
num = (int) ch; //Type Casting
cout<<"ASCII VALUE OF "<<ch<<" IS "<<num;
return 0;
}
ASCII stands for American Standard Code for Information Interchange. Computers can only understand binary numbers, so an ASCII code is the numerical representation of a character.
//Program to display the ASCII value of given character
#include <iostream>
using namespace std;
int main()
{
int num;
char ch;
cout<<"ENTER CHARACTER: ";
cin>>ch;
num = (int) ch; //Type Casting
cout<<"ASCII VALUE OF "<<ch<<" IS "<<num;
return 0;
}