Saturday, December 31, 2011

Find out Ascii of given character in 'C'

Example



#include<stdio.h>
#include<conio.h>
void main()
{
char a;
int b;
clrscr();
printf("Enter the character:");
scanf("%c",&a);
printf("ASCII value of character is:%d",a);
getch();
}
/*========================================================================
OUTPUT
Enter the character:a
ASCII value of character is:97
*/

No comments:

Post a Comment