Signup/Sign In

ASCII value of Character

Below is a program to find ASCII value of any input character.

%c is the format specifier to take character as input

#include<stdio.h>

int main()
{
    printf("\n\n\t\tStudytonight - Best place to learn\n\n\n");

    char c;
    printf("Enter a character : ");
    scanf("%c" , &c);
    printf("\n\nASCII value of %c = %d",c,c);

    printf("\n\n\t\t\tCoding is Fun !\n\n\n");
    return 0;
}

Output:

program to find ASCII value of character in C