C++ program to find Ascii value of input character or symbol

Ascii stands for American Standard Code for Information Interchange.Every character or symbol have its own Ascii value

#include<iostream.h>
#include<conio.h>
#include<ctype.h>
void main()
{
clrscr();
int y;
char x;
cout<<"Enter character or symbol: ";
cin>>x;
y=toascii(x);
cout<<"Ascii value of "<<x<<" is: "<<y;
getch();
}

OUTPUT:-

Leave a Reply

Your email address will not be published. Required fields are marked *