This is a C Program to Find ASCII Value of a Character. After compilation and run of this program, if the user will enter any character, then it will return the ASCII (American Standard Code for Information Interexchange) value of that character.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
#include <stdio.h> int main() { char c; printf("Enter a character: "); // Reads character input from the user scanf("%c", &c); // %d displays the integer value of a character // %c displays the actual character printf("ASCII value of %c = %d", c, c); return 0; } |
Output is:
If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.
Article Tags: ascii character values, ascii value, ascii value for a, ascii value of, ascii value of a character, ascii value of characters in c, special characters ascii values