Program to enter a character and output its ASCII code

Started by aruljothi, Jun 11, 2009, 04:30 PM

Previous topic - Next topic

aruljothi

#include <iostream.h>
#include <conio.h>

void main()
{
clrscr();
char charac;
cout << "Enter the character : " << endl;
cin>>charac;
int num1=charac;
cout << "The ASCII code for " << charac << " is " << num1 << "." << endl;
getch();
}