Signup/Sign In
LAST UPDATED ON: SEPTEMBER 17, 2024

C Program to find ASCII value of Characters

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