How to Print ASCII Value of Character in C

How to Print ASCII Value of Character in C to print the ASCII value of characters or letters in a c programming language. 

ASCII Code Definition

The American Standard Code For Information Interchange (ASCII) is a standard data-transmission code used by smaller and less powerful computers to convey both textual data (letters, numbers, and punctuation marks) and non-input-device commands (control characters). 

ASCII stands for American Standard Code for Information Interchange and is pronounced ask-ee. It’s a numbering system that assigns a number from 0 to 127 to each letter in 128 English letters. The ASCII code for uppercase M, for example, is 77.

Purpose of ASCII Code

ASCII’s goal is to provide a standard for character sets used in electronic devices. The standard assures that different device (made by different firms) can interact with one another using the same character code. Because ASCII code only includes 256 characters, it takes up less space. All alphanumeric characters are saved. In comparison to Unicode, ASCII has a lower memory demand.

int main() 
char c;
printf("Enter a letter");
scanf("%c", &c);
printf("ASCII Value %c = %d", c, c);


Enter a letter r
ASCII Value r = 114