In C programming, a character variable holds ASCII esteem (a whole number between 0 a 127) as opposed to character itself. You will figure out how to discover ASCII estimation of a character in this program.
To comprehend this precedent, you ought to have the learning of following C programming subjects:
C Programming Data Types
C Programming Constants and Variables
C Input Output (I/O)
A character variable holds ASCII esteem (a whole number somewhere in the range of 0 and 127) instead of that character itself in C programming. That esteem is known as ASCII esteem.
For instance, ASCII estimation of 'An' is 65.
This means, on the off chance that you allot 'A' to a character variable, 65 is put away in that factor instead of 'An' itself.
Program to Print ASCII Value
printf("Enter a character: ");
/Reads character contribution from the client
/%d shows the number estimation of a character
/%c shows the genuine character
printf("ASCII estimation of %c = %d", c, c);
Enter a character: G
ASCII estimation of G = 71
In this program, client is requested to enter a character which is put away in factor c. The ASCII estimation of that character is put away in factor c as opposed to that factor itself.
At the point when %d organize string is utilized, 71 (ASCII estimation of 'G') is shown.
At the point when %c arrange string is utilized, 'G' itself is shown.