C PROGRAMMING

C program to find out ASCII value of the character

ASCII stands for American Standard Code for Information Interchange, Today we will write the code, how we can find out ASCII value of the character.

History of ASCII

ASCII was first developed and published in 1963 by the X3 committee, a part of the ASA (American Standards Association). The ASCII standard was first published as ASA X3.4-1963, with ten revisions of the standard being published between 1967 & 1986.

Before going towards the code, first, we will get to know what is ASCII

ASCII is nothing but a code that represents 128 English characters as numbers, with each letter assigned a number from 0 to 127. Uppercase A has ASCII value 65 in decimal. So for Z, the value is 90 in decimal. Lowercase a has ASCII value 97 in decimal. So for z, the value is 122 in decimal.

Below image shows the ASCII code of English characters

We can find out ASCII value in c programming using below code

#include<stdio.h> //contains printf and scanf function
void main() // returns nothing
{
    printf("\n\n\t\tCodehunger - Anyone can learn anything\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 intresting !\n\n\n");
}

Below image shows the output of the code

Shaiv Roy

Hy Myself shaiv roy, I am a passionate blogger and love to share ideas among people, I am having good experience with laravel, vue js, react, flutter and doing website and app development work from last 7 years.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Check Also
Close
Back to top button