Skip to content

Instantly share code, notes, and snippets.

@nalin-adh
Created November 8, 2015 18:06
Show Gist options
  • Save nalin-adh/c80502bc9ce93e9acb71 to your computer and use it in GitHub Desktop.
Save nalin-adh/c80502bc9ce93e9acb71 to your computer and use it in GitHub Desktop.
A C++ program that reads a character and print its integer equivalent.
#include<iostream>
#include<conio.h>
using namespace std;
int main()
{
char a;
cout<<"Enter any character : ";
cin>>a;
cout<<endl<<endl;
cout<<"The equivalent integer value of "<<a<<" is "<<static_cast<int>(a)<<endl;
getch();
return(0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment