C program to print ASCII value of character

EX: Write a C program to print ASCII value of character. How to write a C program which prints ASCII value of character. C program to print ASCII value of character.

Program to print ASCII value of character:


#include<stdio.h>
void main()
{
char ch;
printf("Enter the character: ");
scanf("%c", &ch);
//To print ascii value of character... just we need to print it an intiger format
printf("ASCII value of character %c is %d", ch,ch);
}



Above program shows the following output:

Enter the character: A
ASCII value of character A is 65

No comments:

Post a Comment

If you have any doubts, please discuss here...👇