Write a program to Print ASCII value of any character in C language.

Write a program to Print ASCII value of any character in C language.

ASCII stands for the American Standard Code for Information Interchange.
-Each symbol or each key on keyboard have unique ASCII value.

program-

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


output-

Enter any character
a
97

Enter any character
A
65

Enter any character
Z
90


-In this program, we take a character input by the %c.
-To find the ASCII value we just need to print that character by using %d instead of %c.
-In above outputs ASCII value of a=97,A=65 and Z=90




Read More →
Search
Categories
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!