prev


ASCII value

32. Ascii value of a character (12.7.2009)

/*
Program# 32
date : 25-12-2008
Ascii value of a char
*/

#include <stdio.h>
main(){
char a;
printf("\nEnter a character :");
scanf("%c",&a);
printf("\nASCII value of %c is %d \n",a,a);
}

output:

$ gcc p32.c
$ ./a.out

Enter a character :a

ASCII value of a is 97
$

next
blog comments powered by Disqus