Program to find ascii value of a character in C:
#include<stdio.h>
main()
{
char c;
printf("press any key:\n");
c=getch();
printf("%d ",c); //prints ascii value of entered key in decimal notation
printf("%x ",c); //prints ascii value of entered key in hexa-decimal notation
printf("%o ",c); //prints ascii value of entered key in octal notation
}
ASCII CODES:
#include<stdio.h>
main()
{
char c;
printf("press any key:\n");
c=getch();
printf("%d ",c); //prints ascii value of entered key in decimal notation
printf("%x ",c); //prints ascii value of entered key in hexa-decimal notation
printf("%o ",c); //prints ascii value of entered key in octal notation
}
ASCII CODES:
0 comments:
Post a Comment