description: This program is simple read input from user and store it in character. variable and print it using %d format of c language. here %d is use to print interger value of any given input</code>: Print ASCII value of character/* C Program to Print ASCII Value of given character */ #include <stdio.h> int main() { char character; printf("Enter a character: "); //Get character from the user scanf("%c", &character); // %d print the integer value of a character // %c print the actual character of that integer printf("The ASCII value of %c = %d", character, character); return 0; }output:
Enter a character: J
The ASCII value of J = 74