C Program to Find ASCII Value of a Character - IProgramX

Q. Accept a character from the user and display its ASCII value.


Program

#include <stdio.h>
int main()
{
char ch;
printf("Enter character: ");
scanf("%c", &ch);
printf("ASCII value of %c is %d \n", ch,ch);
}

Output:

Enter character: r
ASCII value of r is 114

Post a Comment

0 Comments