Pages

Tuesday, December 24, 2013

Write a program that displays the ASCII code of character

Source Code:

1
2
3
4
5
6
7
8
9
#include <stdio.h>
#include <conio.h>
void main ()
{
 char ch;
 printf("Enter a character: ");
 ch = getche();
 printf("\n The ANSII code for \'%c\' is %d", ch, ch);
 }

Result:


Enter a character: H
The ANSII code for 'H' is 72

No comments:

Post a Comment