c - How does ASCII value work internally? -
please use code reference telling how giving ascii output
int main() { char c; printf("enter character: "); scanf("%c",&c); /* takes character user */ printf("ascii value of %c = %d",c,c); return 0; }
the line
printf("ascii value of %c = %d",c,c);
will show value of c
in 2 ways. firstly character, secondly number.
whether or not ascii value, depends on c
is, because ascii standard not encompass all of 256 values representable char
or unsigned char
. depends on system settings such code page, language, etc. moreover, not of ascii characters printable - terminal or console outputs use printable representation of number rather using control - although 7
might ring bell!
Comments
Post a Comment