Followers

Sunday, December 11, 2011

CHARACTER TO ASCII CODE

#include<iostream.h>
#include<conio.h>
char ch;

char asc(char ch)
{
 cout<<"Enter a character : ";
 cin>>ch;
 cout<<"The ASCII code for the given character is : "<<int(ch);
 return 0;
}

void main()
{
  clrscr;
  asc(ch);
  getch();
}
.................................................................
OUTPUT:(click to enlarge the image)

No comments:

Post a Comment