Convert Char To Ascii

C++


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

int main()
{
int b;
char a='k';

clrscr();
cout<<"Programmer -> Omid Bahrami "<<endl;
cout<<"Press Any Key To See The Ascii Code [Press q To Exit]"<<endl<<endl;
while(a!=113)
{
kbhit();

a=getch();
b=a;
if(b==13)
cout<<"[ Enter ] Code ---> 13"<<endl;

else if (b==32)
cout<<"[ Space ] Code ---> 32"<<endl;

else if(b!=0)
cout<<"[ "<<a<<" ] Code ---> "<<b<<endl;
}

cout<<endl<<"Good Luck";
getch();
return 0;
}