This prints out all ASCII values:
int main()
{
int i;
i=0;
do
{
printf("%d %c
",i,i);
i++;
}
while(i<=255);
return 0;
}
and this prints out the ASCII value for a given character:
int main()
{
int e;
char ch;
clrscr();
printf("
Enter a character : ");
scanf("%c",&ch);
e=ch;
printf("
The ASCII value of the character is : %d",e);
getch();
return 0;
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…